Web Development with jQuery®

(Elliott) #1

(^120) ❘ CHAPTER 4 MANIPULATING CONTENT AND ATTRIBUTES
selection, but instead of the selected element being placed in a wrapper, its contents are placed in a
wrapper. The following document, Example 4-11, which is the same document you saw in the last
two examples, demonstrates how the wrapInner() method compares and contrasts with the wrap()
and wrapAll() methods:
<!DOCTYPE HTML>






Mitch Hedberg Quotes






Mitch Hedberg Quotes



Dogs are forever in the push up position.



I haven’t slept for ten days, because that would be too long.



I once saw a forklift lift a crate of forks. And it was way
too literal for me.




The following style sheet is applied to the preceding markup document:
body {
font: 12px "Lucida Grande", Arial, sans-serif;
color: rgb(50, 50, 50);
margin: 0 ;
padding: 15px;
}
span {
background: yellow;
}
p {
margin: 5px;
}
In the following script, you see that the only change from the preceding two examples is that the
wrapInner() method is used instead of the wrap() or wrapAll() methods:
$(document).ready(
[http://www.it-ebooks.info](http://www.it-ebooks.info)
Free download pdf