1. Directly reference a node
1.doc ument. getElementById (id );
-- Find the node through id in the document
2.doc ument. getElementByTagName (tagName );
-- Returns an array containing references to these nodes.
-- For example, document.
(1) Create a new nodevar para=document.createelement ("P"); Create a new element var Node=document.createtextnode ("This is the new paragraph. "); Created a text node para.appendchild (node); Append this text node var
Methods to get elementsWhoever is to be manipulated must first obtain whom;Get element 1, document.getElementById: Get element by ID name
compatibility: Under IE8, the name attribute is acquired by default as an ID; document: documentation;
BOM operation one, what is a BOMBOM (Browser object model)The BOM provides an object that is independent of the content and interacts with the browser window;A BOM is composed of a series of related objects, and each object provides many methods and
The previous article talked about the basics of DOM, where DOM can manipulate XML and HTML, this time using the DOM API to manipulate XML and HTML documents.DOM manipulation XMLThe DOM must load the XML document into an XML DOM object before
Dom adding elements, using node properties
dom add elements, using node properties item 1
[Ctrl + A All SELECT Note: If the need to introduce external JS need to refresh to perform]
First, Dom Basics
1. Nodes (node)
1. DOM function
A, Domdocument->load ()Function: Load XML fileUsage: domdocument->load (string filename)Parameters: Filename,xml file;Return: Returns TRUE if successful and FALSE if failed.
B, Domdocument->loadxml ()function: Load XML codeUsage:
DOM is an abbreviation of the Document Object model. Based on the DOM specification, Dom is a browser, platform, language-independent interface that allows you to access other standard components of the page.
characteristics and methods of node
DOM element Basic Operation Method API, first record, easy to use later.
The consortium DOM and JavaScript are easily confusing. The DOM is an API for HTML and XML documents that provides a structured representation of the document and defines how
Basic Knowledge Review:
Dom is the Document Object model, the DOM is actually processing HTML as an XML file, looking at the HTML with the object's eye, which can be said to be the most useful invention of the web after HTML.
Some Review of XML
DomDOM is the abbreviation for Document Object model. The Document Object model is a document that takes XML or HTML as the representation of a tree node. With Dom methods and properties, you can access, modify, delete any element on the page, and
xml| objects
XML Document Object Model1 DOMDocument object: This object describes all the document mapping tables, and the document mapping table contains all the information in the XML document.Common methodsCommon Properties2 IXMLDOMNode Object:
I encountered a problem today. I need to get the tagName. I used jquery to query it. We use $ (& quot; dd & quot ;). attr (& quot; tagName & quot;) can be obtained, but the returned value is undefined. As a result, after a long query, the returned
Recently, it was found that the DOMDocument object is very important, and XMLHTTP is also very important. The case must not be wrong. attribute:
1 Attributes storage node attribute list (read-only)
2. List of child nodes of the childNodes storage
ASP. NET XmlDocument
This article mainly introduces the ASP. NET XmlDocument class details. This article describes the attributes of XmlDocument, the method of XmlDocument, the events of XmlDocument, and the usage examples of XmlDocument. For more
Xml operations are often used. Java contains dom, dom4j, and other tool classes, but Javascript does not. So I wrote one myself. Currently, it is counted as the first version. There must be many improvements. If you need them, you can leave a
I was stuck with this question during the recent interview, so I took the time to review it. Several objects NodeNode is an interface called a node in Chinese. Many types of DOM elements inherit from it and share the same basic...
I was stuck with
HTML DOM Element (elements)The document itself is a document node.All HTML elements are element nodes.All HTML attributes are attribute nodesText within an HTML element is a text node.A comment is a comment node.The usage of node1. If you want to
In the HTML DOM, when you get an element object, you often don't remember many of its properties, and you can look it up in the following example:1 DOCTYPE HTML>2 HTML>3 Body>4 H1>Get Object properties and valuesH1>5 DivID= "Div1"class= "Div"
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.