Recent work has always encountered a variety of father Ah son Ah brothers and sisters Ah, every time to check, this time to organize a internationals ~
First, we'll have dry goods:
"JS access Mode"
<div id = "Dom" >
</div>
function dom () {
var a = document.getelementbyidx_x_x ("Dom");
var b = a.childnodes; Gets all the child nodes of a
var c = a.parentnode; Gets the parent node of a of
var d = a.nextsbiling; Gets the next sibling node of a
var e = a.previoussbiling; Gets the previous sibling of A's node
var f = a.firstchild; Gets the first child node of a,
var g = a.lastchild; Get the last child node of a
"How jquery is captured."
Jquery.parent (expr) for the Father node, you can filter through expr, such as $ ("span"). Parent () or $ ("span"). Parent (". Class")
jquery.parents (expr , similar to jquery.parents (expr), but is to find all ancestor elements, not limited to the parent element
Jquery.children (expr). Returns all child nodes, this method only returns the direct child node, does not return all descendants node
jquery.contents () returns all of the following, including nodes and text. The difference between this method and children () is that the inclusion of blank text is also returned as a
JQuery object, and children () returns only the node
Jquery.prev (), returning to the last sibling node, Not all sibling nodes
Jquery.prevall (), return all previous sibling nodes
Jquery.next (), return to the next sibling node, not all sibling nodes
Jquery.nextall (), Returns all subsequent sibling nodes
Jquery.siblings (), returning sibling nodes,
jquery.find (expr), completely different from jquery.filter (expr). The Jquery.filter () is filtered out from the initial set of JQuery objects, and the return result of Jquery.find () does not have the contents of the initial collection, such as $ ("P"), Find ("span"), which is found from the P element, equivalent to $ ("p Span ")