W3C DOM tests - innerHTML and friends

This is element x. It contains a strong and an em.

This page tests a few basic HTML DOM properties.

Test scripts

innerHTML

alert(x.innerHTML)
x.innerHTML = "Let's <u>change</u> it!"

innerText

alert(x.innerText)
x.innerText = "Let's change it!"
x.innerText = "Let's <u>change</u> it!"

outerHTML

After changing the outerHTML, the alert should show <div id="test">

alert(x.outerHTML)
x.outerHTML = "Let's <u>change</u> it!"

outerText

alert(x.outerText)
x.outerText = "Let's change it!"
x.outerText = "Let's <u>change</u> it!"

textContent

alert(x.textContent)
x.textContent = "Let's change it!"
x.textContent = "Let's <u>change</u> it!"