0x01The DOM is the interface of the JavaScript Operation Web page, all called the Document Object model. Its role is to convert the Web page into a JavaScript object, so that you can use JavaScript to do various things (such as adding and deleting
Properties of the DOM nodeProperty DescriptionAttributes array gets all the property subnodes of a node (actually a NodeList object)The childnodes array gets all the child nodes of a node, can access the child nodes in an array way, and also
JavaScript can manipulate the entire browser, but this browser object is larger, so for ease of operation, it is divided into three objects.1.BOM objectsBOM Object main operation address bar, browsing history, window height and so on.2.DOM
1. Node and type1) Document node entire HTML document2) Element node: HTML tag in HTML document3) Attribute node: An attribute of an element that can be manipulated directly by property4) Text node: is a child node of an element node whose contents
1 DivID= "Div">2 TableID= "tab">3 TR>4 th>Numberth>5 th>Nameth>6 th>Genderth>7 th>Ageth>8 TR>9 Table>Ten Div>The HTML content table adds rows and cells to JS and has a delete
①, create an element node:var reference = document.createelement (Element)
createelement (): Creates a new element node according to the given label name.
Method has only one parameter : The name of the element node being created, is a
Dom Event Flow:The DOM (Document Object model) structure is a tree structure, and when an HTML element produces an event, the event propagates in a particular order between the element node and the root node, and the node that passes through the
Deep Learning JS NodeDOM (model)All the nodes in the HTML document make up a document tree model,Every element, attribute, text, and so on in an HTML document represents a treeA node. These nodes are interconnected and affect each other to form aThe
One, JavaScript to determine the object type 1, you can use the TypeOf function to determine the object type1 function CheckObject1 () {2 var str= "str"; 3 Console.log (typeof(str))// Output "string"; 4 Console.log (typeof(str) = =
DOM Tree First, it is helpful to visualize the DOM tree of a HMTL document. A simple HTML page looks like this:event Bubbling (also known as event propagation)When we click on a link, it triggers the Click event of the link element, which raises
Original: The difference and use of bind (), Live () in jquery (event handling)Using jquery for a while, when you start to look at someone else's source code, you have doubts about how the event is bound. Like what:var btn=$ ("#button"); Btn.click (
The HTML DOM is the standard for how to get, modify, add, or delete HTML elements. In the HTML DOM, all things are nodes. The DOM is the HTML that is treated as a node tree.
All content in an HTML document is a node, based on the HTML DOM standard
L TinyXML Introduction
TinyXML is currently a very popular based on the DOM model of the XML parser, easy-to-use and small, very suitable for storing simple data, configuration files, object serialization and other data volume is not a very large
Ext contains several methods that begin with get, which can be used to obtain the DOM in the document, to get the components in the current document, to get the ext element, and so on, to be aware of the difference in use. 1 , get method gets method
1. Get through top-level document node:(1) document.getElementById (ElementID): Gets the node by ID, if the page contains multiple nodes with the same ID, then only the first node is returned.(2) Document.getelementsbyname (elementname): Gets the
This example describes the jquery traversal DOM element and node method. Share to everyone for your reference, specific as follows:
One, up traversal--ancestor element
①$ (selector). parent ([filter]): Returns the direct parent element of a
Dom Tree
First, it is helpful to visualize a DOM tree for a HMTL document. A simple HTML page looks like this:
Event bubbling (also known as event propagation)
When we click on a link, it
Xml| Programming | Application Examples This article introduces 3 basic examples of XML that are designed to lead you quickly into the world of XML programming. Examples include: in. NET using XML, reading XML files, inserting data into XML
In JavaScript, you often encounter situations where you want to listen to multiple Li in a list, assuming we have a list of the following:
Copy Code code as follows:
item1
item2
item3
item4
If we want to achieve
One, Element node
Copy Code code as follows:
Test element node, output node name, node type, node value
var lielements=document.getelementsbytagname ("Li");
for (Var i=0;ialert (lielements[i].nodename);
alert
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.