JQuery----Document Processing

Source: Internet
Author: User

1.append (CONTENT|FN)

Overview

Appends content to each matching element.

This action is similar to the case where the AppendChild method is executed on the specified element, adding them to the document.

2.appendTo (content)

Overview

Appends all matching elements to another specified set of element elements.

In fact, using this method reverses the normal $ (A). Append (b) operation, that is, instead of appending B to a, append a to B.

3.prepend (content)

Overview

The contents of the predecessor to each matched element.

This is the best way to insert content at the beginning of all matching elements.

4.prependTo (content)

Overview

Puts all matching elements in front of another, specified set of element elements.

In fact, using this method is reversed by the regular $ (A). Prepend (b) operation, that is, instead of putting B in front of a, instead of placing a in front of B.

5.after (CONTENT|FN)

Overview

Inserts the content after each matching element.

6.before (CONTENT|FN)

Overview

Insert the content before each matching element.

7.insertAfter (content)

Overview

Inserts all matching elements behind another, specified set of element elements.

In fact, using this method reverses the normal $ (A). After (b) operation, that is, instead of inserting b behind a, insert a into the back of B.

8.insertBefore (content)

Overview

Inserts all matching elements in front of another, specified set of element elements.

In fact, using this method is reversed by the regular $ (A). Before (b) operation, that is, instead of inserting b into front of a, insert a into front of B.

9.wrap (HTML|ELE|FN)

Overview

Wrap all matching elements with a structured tag of other elements.

This wrapper is most useful for inserting additional structured markup into a document, and it does not break the semantic quality of the original document. The principle of this function is to examine the first provided element (which is dynamically generated by the provided HTML markup code) and to find the topmost ancestor element in its code structure-the ancestor element is the package element . This function cannot be used when an element in an HTML markup code contains text. Therefore, if you want to add text, you should add it after the package is complete.

10.unwrap ()

Overview

This method moves the parent element out of the element. This can quickly cancel the effect of the. Wrap () method. Matching elements (and their sibling elements) replace their parent elements on the DOM structure.

11.wrapAll (Html|ele)

Overview

Wrap all matching elements together with a single element

This is different from the '. Wrap () ' <a href= "Http://docs.jquery.com/Manipulation/wrap" title= "Manipulation/wrap" ></a>. Wrap () is wrapped once for each matching element. This wrapper is most useful for inserting additional structured markup into a document, and it does not break the semantic quality of the original document. The principle of this function is to examine the first provided element and find the topmost ancestor element in its code structure-the ancestor element is the wrapper element.

HTML Description:

Wrap all paragraphs together with a generated div

JQuery Code:
$("p").wrapAll("<div></div>");
12.wrapInner (HTM|ELE|FNL)Overview

Wraps the child content of each matching element (including the text node) with an HTML structure.

The principle of this function is to examine the first provided element (which is dynamically generated by the provided HTML markup code) and to find the topmost ancestor element in its code structure-the ancestor element is the wrapper element.

13.replaceWith (CONTENT|FN)

Overview

Replaces all matching elements with the specified HTML or DOM element.

14.replaceAll (selector)

Overview

Replace all elements that match the selector with matching elements.

15.empty ()

Overview

Deletes all the child nodes in the matching element collection.

16.remove ([expr])

Overview

Removes all matching elements from the DOM.

This method does not remove the matching elements from the jquery object, so that the matching elements can be used in the future. But besides the element itself is preserved, other such as bound events, additional data, etc. will be removed.

17.detach ([expr])

Overview

Removes all matching elements from the DOM.

This method does not remove the matching elements from the jquery object, so that the matching elements can be used in the future. Unlike remove (), all bound events, attached data, and so on are preserved.

18.clone ([Even[,deepeven]])

Overview

Clones the matching DOM elements and selects copies of those clones.

This function is useful when you want to add a copy of an element in a DOM document to another location.

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.