jquery Delete node Add node to find the simple realization of sibling node _jquery

Source: Internet
Author: User

$ (). 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

$ (). Append (' <a>something</a> ')//The method adds this a tag at the end of the current node

$ (). After (' <span style= "font-family:arial, Helvetica, Sans-serif;" ><a>something</a></span> '//The method adds this a tag after the current node is equivalent to adding a sibling element

$ (). Before (' <span> </span> ') by the same token, add a span to the front of a particular element

$ (). Prev ();

This method finds the previous sibling node of the current node, and the neighboring previous sibling

$ (). Next ();

This method will find the next sibling node of the current node, the next sibling node

$ (). Prevall ();

This method finds all sibling nodes before the current node

$ (). Nextall ();

This method finds all sibling nodes after the current node

$ (). siblings ();

This method finds all sibling nodes of the current node including before and after

---These methods parentheses inside please add selector to filter please note that the child nodes under sibling nodes and sibling nodes are different concepts

These are simple methods that are complicated and have to refer to the jquery API

This jquery delete node to add nodes to find the simple realization of the sibling node is small series to share all the content, hope to give you a reference, but also hope that we support the cloud habitat community.

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.