<?xml version='1.0' encoding='ISO-8859-1'?>
<?xml-stylesheet type='text/xsl' href='docs.xsl'?>
<docs>
<method cat='DOM/Manipulation' type='jQuery' short='Wrap all matched elements with a structure of other elements.' name='wrap'>
<desc>Wrap all matched elements with a structure of other elements.
This wrapping process is most useful for injecting additional
stucture into a document, without ruining the original semantic
qualities of a document.

This works by going through the first element
provided (which is generated, on the fly, from the provided HTML)
and finds the deepest ancestor element within its
structure - it is that element that will en-wrap everything else.

This does not work with elements that contain text. Any necessary text
must be added after the wrapping is done.</desc>
<params type='String' name='html'>
<desc>A string of HTML, that will be created on the fly and wrapped around the target.</desc>
</params>
<examples>
<code>$("p").wrap("&lt;div class='wrap'&gt;&lt;/div&gt;");</code>
<result>&lt;div class='wrap'&gt;&lt;p&gt;Test Paragraph.&lt;/p&gt;&lt;/div&gt;</result>
<before>&lt;p&gt;Test Paragraph.&lt;/p&gt;</before>
</examples>
</method><method cat='DOM/Manipulation' type='jQuery' short='Wrap all matched elements with a structure of other elements.' name='wrap'>
<desc>Wrap all matched elements with a structure of other elements.
This wrapping process is most useful for injecting additional
stucture into a document, without ruining the original semantic
qualities of a document.

This works by going through the first element
provided and finding the deepest ancestor element within its
structure - it is that element that will en-wrap everything else.

This does not work with elements that contain text. Any necessary text
must be added after the wrapping is done.</desc>
<params type='Element' name='elem'>
<desc>A DOM element that will be wrapped around the target.</desc>
</params>
<examples>
<code>$("p").wrap( document.getElementById('content') );</code>
<result>&lt;div id="content"&gt;&lt;p&gt;Test Paragraph.&lt;/p&gt;&lt;/div&gt;</result>
<before>&lt;p&gt;Test Paragraph.&lt;/p&gt;&lt;div id="content"&gt;&lt;/div&gt;</before>
</examples>
</method></docs>
