[jquery document Processing Wrapall (Html|ele)]) This method is used to wrap all matching elements using the specified HTML element

Source: Internet
Author: User

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

Example:

;} Html{font:  15px/1.2em ' Courier New '; color: #666; width:750px;margin:25px auto;} Ul{list-style:none;} . Hover{color: #FF96EC;} . Wrapall{color: #FF96EC;}  </style><script type= ' text/javascript ' > function   () {
/**
*/
       $('. List '). Wrapall (Document.createelement ("div"))); //$ ('. List '). Wrap (Document.createelement ("div"));//Match each matched element once    });</script> Thisis unwrap test</p> </div> </div> <p class= ' list ' > Thisis unwrap test</p> </div></body>

[jquery document Processing Wrapall (Html|ele)]) This method is used to wrap all matching elements using the specified HTML element

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.