First, get the parent element
1. Parent ([expr]): Gets all the parent elements of the specified element
Second, get the sibling elements:
1, next ([expr]): Gets the next sibling element of the specified element
2. Nextall ([expr]): Gets all sibling elements behind the specified element
<p>Hello</p>
<p>hello again</p>
<div><span>and again</span> </div>
var P_nex = $ ("P"). Nextall (). Andself ();
P_nex.addclass (' P_next_all ');
Select all the sibling tags that follow the p tag, and
4, prev (): Gets the previous sibling element of the specified element
5, Prevall (): Gets all sibling elements in front of the specified element, index from near [0]->[n]
Third, get child elements
1. Find child element mode 1:>
For example: var anods = $ ("ul > a"); Find all a labels under UL
2. Find child element Mode 2:children ()
3. Find child element Mode 3:find ()
Similarities and differences between children () and find ():
The 1> children and find methods are used to obtain the sub-elements of element, neither of which will return text node, just like most jquery methods.
The 2> children method obtains only the sub-elements of the next level of the element, namely: immediate children.
The 3> Find method obtains all subordinate elements, namely: descendants of these elements in the DOM tree
The parameter selector of the 4> children method is optional (optionally) and is used to filter the child elements, but the parameter selector method of the Find method is required.
The 5> Find method can actually be implemented by using JQuery (selector, context). That is $ (' li.item-ii '). Find (' Li ') is equivalent to $ (' Li ', ' Li.item-ii ').
Reprint Address: http://www.cnblogs.com/Tally/archive/2013/01/04/2844042.html