15.02.2013 Views

JavaScript Examples Bible - UserWorks Technologies

JavaScript Examples Bible - UserWorks Technologies

JavaScript Examples Bible - UserWorks Technologies

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Chapter 5 ✦ Body Text Objects (Chapter 19)<br />

Example<br />

See Listing 19-7 earlier in this chapter to see the selection.clear() method at<br />

work.<br />

createRange()<br />

NN2 NN3 NN4 NN6 IE3/J1 IE3/J2 IE4 IE5 IE5.5<br />

Compatibility ✓ ✓ ✓<br />

Example<br />

See Listings 15-36 and 15-45 to see the selection.createRange() method turn<br />

user selections into text ranges.<br />

empty()<br />

NN2 NN3 NN4 NN6 IE3/J1 IE3/J2 IE4 IE5 IE5.5<br />

Compatibility ✓ ✓ ✓<br />

Example<br />

See Listing 19-7 earlier in this chapter to view the selection.empty() method<br />

at work.<br />

Text and TextNode Objects<br />

Properties<br />

data<br />

NN2 NN3 NN4 NN6 IE3/J1 IE3/J2 IE4 IE5 IE5.5<br />

Compatibility ✓ ✓ ✓ ✓<br />

Example<br />

In the example for the nodeValue property used in a text replacement script (in<br />

Chapter 1 of this book), you can substitute the data property for nodeValue to<br />

accomplish the same result.<br />

293<br />

TextNode.data

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!