I'm fairly new to javascript and was wondering how I could use javascript to change text in a single part of my table, as opposed to writing the whole page again with document.write.
Printable View
I'm fairly new to javascript and was wondering how I could use javascript to change text in a single part of my table, as opposed to writing the whole page again with document.write.
You can use innerHTML, although it's not officially in the spec and Opera doesn't [yet] support it:
Code://NAME attribute:
document.elementName.innerHTML = '<em>This</em> is the new text, etc';
//ID attribute:
document.getElementById('elementId').innerHTML = '<em>This</em> is the new text, etc';
hmm thanks
who cares about opera :) (jk... please don't eat my babies)
HEh, your babies will be eaten ;) Opera 7 is supposed to be comming out at the end of the year, and it may have a fix for that. They're implementing a better DOM so they may add innerHTML.