15.02.2013 Views

JavaScript Examples Bible - UserWorks Technologies

JavaScript Examples Bible - UserWorks Technologies

JavaScript Examples Bible - UserWorks Technologies

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

28 <strong>JavaScript</strong> <strong>Examples</strong> <strong>Bible</strong>: The Essential Companion to <strong>JavaScript</strong> <strong>Bible</strong><br />

While the myEM element is shown as disabled, no change has accrued to its<br />

disabled property:<br />

myEM.disabled<br />

This property value remains the default false.<br />

isMultiLine<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 read the isMultiLine<br />

property for elements on that page. Try the following statements in the top text box:<br />

document.body.isMultiLine<br />

document.forms[0].input.isMultiLine<br />

myP.isMultiLine<br />

myEM.isMultiLine<br />

All but the text field form control report that they are capable of occupying multiple<br />

lines.<br />

isTextEdit<br />

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

Compatibility ✓ ✓ ✓<br />

Example<br />

Good coding practice dictates that your script check for this property before<br />

invoking the createTextRange() method on any object. A typical implementation<br />

is as follows:<br />

if (document.all.myObject.isTextEdit) {<br />

var myRange = document.all.myObject.createTextRange()<br />

[more statements that act on myRange]<br />

}<br />

lang<br />

elementObject.lang<br />

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

Compatibility ✓ ✓ ✓ ✓

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

Saved successfully!

Ooh no, something went wrong!