11.12.2012 Views

JavaScript 2.0-The Complete Reference, Second ... - freecodingtutorial

JavaScript 2.0-The Complete Reference, Second ... - freecodingtutorial

JavaScript 2.0-The Complete Reference, Second ... - freecodingtutorial

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.

}<br />

window.document.testform.nodeType.value = currentElement.nodeType;<br />

window.document.testform.nodeValue.value = currentElement.nodeValue;<br />

function nodeMove(currentElement, direction)<br />

{<br />

switch (direction)<br />

{<br />

case "previousSibling": if (currentElement.previousSibling)<br />

currentElement.previousSibling;<br />

else<br />

break;<br />

currentElement =<br />

alert("No previous sibling");<br />

case "nextSibling": if (currentElement.nextSibling)<br />

currentElement.nextSibling;<br />

else<br />

break;<br />

currentElement =<br />

alert("No next sibling");<br />

case "parent": if (currentElement.parentNode)<br />

currentElement = currentElement.parentNode;

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

Saved successfully!

Ooh no, something went wrong!