BIT 116 – Scripting

DOM (Document Object Model)


Part 1: nodeValue vs. innerHTML

You should be able to compare & contrast an element's innerHTML vs. the element's innerText properties - for each one, you should be able to describe what effect changing it will have.  If you set the innerHTML property to be "Hello, <B>World</B>", what would you expect to see in the browser?  What if you set an element's innerText property to the same string?

Similarly, you should familiarize yourself with the element's outerHTML property, and the element's outerText property

Quirksmode reference: http://www.quirksmode.org/dom/w3c_html.html#t03

Part 2: Table specific DOM stuff

Create a document that contains a couple textboxes, as well as several buttons.  In one of the textboxes, the user should input their name.  In another box, they should input their score.  When a button is clicked, you should be able to add the person's name & score to the table.  You should be able to do this for both Firefox (using the standard DOM manipulation routines we've seen so far), as well as for Internet Explorer, using the W3C Table-specific DOM routines.

Further reference for the Table-specific stuff is found at Quirksmode: http://www.quirksmode.org/dom/w3c_html.html#tables