For example, a UL has 10 Li, and the 3rd Li has a special style (such as red color, the other is black). I want all other li--not including red li--color also set to red, at this time, you need to get red Li's all sibling nodes.
Brother, is peace
For example, a UL has 10 Li, and the 3rd Li has a special style (such as the color is red, the other is black). I want all the other li--not including the red li--color also set to red, at this time, you need to get red Li all the Brothers
$ (). empty (); This method deletes all child nodes under the current node, noting that the current node will not be deleted
$ (). remove (); This method deletes all child nodes under the current node, noting that the current node will be deleted
$
This article mainly introduced jquery's parent-child sibling node lookup method, the need for friends can refer to the
Jquery.parent (expr) for the Father node, you can filter through expr, such as $ ("span"). Parent () or $ ("span"). Parent (".
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
1. Querying all descendant nodes under a node (including parent nodes at all levels)1 // all descendant nodes with a query ID of 101, all levels of parent nodes, including 101 2 Select T.*from +='101'by = Prior ID2. Querying all descendant nodes
Jquery parent-child sibling node search sample code
This article describes how to find the parent and child node of jquery. For more information, see
JQuery. parent (expr) finds Father's Day points and can pass in expr for filtering, for example,
One, JS get Element (parent node, child node, sibling node) var test = document.getElementById("test"); var parent = test.parentNode; // 父节点 var chils = test.childNodes; // 全部子节点 var first = test.firstChild; // 第一个子节点 var last =
Jquery.parent (expr)//Find parent ElementJquery.parents (expr)//Find all ancestor elements, not limited to parent elementsJquery.children (expr)//Find all child elements, will only find the immediate child node, will not return all descendantsJquery.
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
This article describes how to find jquery's parent and child node. For more information, see jQuery. parent (expr) finds Father's Day points and can pass in expr for filtering, for example, $ ("span "). parent () or $ ("span "). parent (". class ")
Above is a TR, no ID, now on one of the name Wgrkbillentry[0].fauxqty TD double-click event, the following is the double-click eventfunction Fun_tevl (ele) {Gets the parent node of the current node TRvar tr1 = Ele.parentNode.parentNode;Gets the
tell me how to locate the parent and sibling nodes when locating elements on the mobile app Here are two of the most commonly used methods, Other ways to see other chapters of the blog Instance: We are now going to navigate to the second
JQuery. parent (expr) finds Father's Day points and can pass in expr for filtering, for example, $ ("span "). parent () or $ ("span "). parent (". class ")JQuery. parents (expr) is similar to jQuery. parents (expr), but it is used to find all
-------------------------------------------------------------------Source Address: http://www.cnblogs.com/yunlei0821/p/7577400.html, reproduced please be sure to keep this source.Child (/ Sun ) node : . Children ([selector]). gets all immediate
You can use the previussibling and nextSibling attributes between sibling nodes to access different subnodes at the same level. What if this sibling node is an element or a text node running on a modern browser? Except IE, the browser uses a line
JavaScript is used to obtain the prev and next methods of an element adjacent to a sibling node.
This example describes how to use JavaScript to obtain the prev and next methods of an element's adjacent sibling nodes. We will share this with you
this is a span in Div 1this is a span in Div 2this is a span in Div 1this is a span in Div 2this is a span in Div 1this is a span in Div 2this is a span in Div 1this is a span in Div 2Get parent node, sibling node and processing attribute node in JS
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.