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.

dir<br />

Chapter 1 ✦ Generic HTML Element Objects (Chapter 15)<br />

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

Compatibility ✓ ✓ ✓<br />

Example<br />

Changing this property value in a standard U.S. version of the browser only<br />

makes the right margin the starting point for each new line of text (in other words,<br />

the characters are not rendered in reverse order). You can experiment with this in<br />

The Evaluator by entering the following statements into the expression evaluation<br />

field:<br />

document.getElementById(“myP”).dir = “rtl”<br />

disabled<br />

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

Compatibility (✓) ✓ ✓ ✓<br />

Example<br />

Use The Evaluator (Chapter 13 in the <strong>JavaScript</strong> <strong>Bible</strong>) to experiment with the<br />

disabled property on both form elements (IE4+ and NN6) and regular HTML<br />

elements (IE5.5). For IE4+ and NN6, see what happens when you disable the output<br />

textarea by entering the following statement into the top text box:<br />

document.forms[0].output.disabled = true<br />

The textarea is disabled for user entry, although you can still set the field’s value<br />

property via script (which is how the true returned value got there).<br />

If you have IE5.5+, disable the myP element by entering the following statement<br />

into the top text box:<br />

document.all.myP.disabled = true<br />

The sample paragraph’s text turns gray.<br />

document<br />

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

Compatibility ✓ ✓ ✓<br />

21<br />

elementObject.document

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

Saved successfully!

Ooh no, something went wrong!