Direct reference 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. getelementbytagname
Getelementbyid getelementsbyname getelementsbytagname
Getelementbyid obtains the node through the ID attribute of the node. This object contains attributes such as nodename, nodetype, parentnode, and childnodes.
Nodename indicates the node name. If
Recently, I am working on a website to add a keyword link to all the articles on the website. When we browse some articles on the website, some keywords in the article are added with links and highlighted.
At the beginning, the Technical Department
XML Document Object Model
1)DomdocumentObject: This object describes all the document ing tables. The document ing table contains all the information in the XML document.Common MethodsCommon attributes
2)IxmldomnodeObject: This object describes the
First, create the HTML page sort.html and copy the following content.
Copy codeThe Code is as follows:
untitled document
ID | -
name | -
1
happy
3
open meal
5
open
ID | -
name | -
1
happy
At the beginning, the Technical Department intends to replace the keyword in the article with the tag when adding or modifying the article in the background. But there are some problems.
If a new keyword is added, do all the articles have to be
7. Create a Node
In DOM operations, adding and deleting operations must find the parent node
1, DomElement domdocument::createelement (String $name [, String $value])
Creates a node and returns a Node object
String $name: Name of the node (element
: This article mainly introduces XMLDOM (11) in php. if you are interested in the PHP Tutorial, refer to it. 7. create a node
In dom operations, you must find the parent node for addition, deletion, and modification operations.
1. DOMElement
Dom:document Object Model Document objectsDocuments: HTML pagesDocument objects: Elements in a pageDocument Object Model: definition to enable the program (JS) to manipulate elements in the pageThe DOM sees the document as a tree and defines a
XML DOM
Xml dom defines the standard methods for accessing and processing XML documents.
Xml dom is the abbreviation of XML Document Object Model, that is, the XML Document Object Model.
1. Introduction to Dom
What is Dom?
Dom is a W3C
Article-better Layout
Source code download
Problem description Two days ago, we met this requirement to dynamically add CSS styles to the page, which are inline styles rather than external CSS files.As usual, I wrote the followingCode:
1. DOM functions
A, Domdocument->load ()
Role: Loading an XML file
Usage: domdocument->load (string filename)
Parameters: Filename,xml file;
Returns: TRUE if successful, or FALSE if unsuccessful.
B, Domdocument->loadxml ()
Role: Loading XML
The innerHTML of tbody in the IE6-IE9 cannot be assigned a value. The reproduction code is as follows:Copy codeThe Code is as follows: innerHTML of tbody in IE6-IE9 cannot copy bug aaa GET SET Two buttons: the first to get the innerHTML of
JavaScript: DOM programming 1Zookeeper
JavaScript: DOM Programming1. nodes and their types1) Element Node2) attribute node: the attribute of the element. Generally, the Operation attribute node directly reads and writes the attribute value through
HTML element attributes and Dom properties
Element type node
Text Type node
HTML element attributes and Dom propertiesThe property of the attribute and Dom objects in the HTML tag is two more confusing concepts, in fact, both of which
DOM to add elements and use node attributes Add an element to the DOM, use node attributes Item 1 [Ctrl + A select all Note: If you need to introduce external Js, You need to refresh it to execute]I. DOM Basics1. node
Today I learned how to use native js to write dom elements (nodes). The following are the notes compiled by W3C in combination with the learned documents:1. Add nodesCreate a node: create an element using createElement and create a text node using
As a js-DOM developer, you must know some DOM methods:1. Create a node.CreateElement ():Var a = document. createElement ("p ");It creates an element node, so nodeType is equal to 1.A. nodeName will return p;Note: The new element node created by the
Control File: system32 \ shdocvw. oca shdocvw. dllRegistration: regsvr32 shdocvw. dllWebBrowser is a VB Control made by the IE kernel,WebBrowser. Document is the automatic Object returned for the active Document. You can reference Microsoft HTML
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.