Jquery.parent (expr)//Find the parent element
Jquery.parents (expr)//Find all ancestor elements, not limited to parent elements
Jquery.children (expr)//Find all child elements, will only find the direct child node, will not return all descendants
Jquery.contents ()//Find all content below, including nodes and text.
Jquery.prev ()//Find the previous sibling node, not all sibling nodes
Jquery.prevall ()//Find all previous sibling nodes
Jquery.next ()//Find Next sibling node, not all sibling nodes
Jquery.nextall ()//Find all later sibling nodes
Jquery.siblings ()///Find sibling nodes, no points before and after
Jquery.find (expr)//is completely different from jquery.filter (expr), jquery.filter (expr) from the initial
A subset of the jquery objects is filtered out, and the return result of Jquery.find () does not have an initial concentration
Filter out a part, and the return result of Jquery.find () does not have the contents of the initial collection, for example:
$ ("P"). FIND ("span") is to start from the element, equal to $ ("P span")
In jquery we can choose $ (). each () and $.each () to iterate over the object and array
$ (items). each (function () {
//item
While the latter
$.each (Items,function (i,item) {
//write your code
})
$ ("button"). Click (function () {
$ ("Li"). each (function () {
alert ($ (this). Text ())
}
); $ ("#ID >div"). each (the function () {
alert ($ (this). attr ("id"));//print the ID of the child Div
});
The loop ID is all input labels under plan_value, and when the label type is a hidden label, get the next tab and manipulate their values
var plan_value_str = "";
$ ("#plan_value >input"). each (the function () {
if ($ (this). attr ("type") = = "hidden") {
if (plan_value_str = = "" {
Plan_value_str = $ (this). attr ("value") + "-" +$ (This). Next (). attr ("value");
} else{
plan_value_str = plan_value_str+ ";" +$ (This). attr ("value") + "-" +$ (This). Next (). attr ("value");}}
)
$ ("#plan_value_str"). Val (PLAN_VALUE_STR);
The above jquery of the parent, child, sibling node lookup, node of the sub-node loop method is small to share all the content of everyone, hope to give you a reference, but also hope that we support cloud habitat community.