Results 1 to 2 of 2
Thread: JS div replace
-
04-22-2003, 10:56 PM #1WHT Addict
- Join Date
- Feb 2002
- Posts
- 109
JS div replace
What's the code - for different browsers - to replace text in a DIV tag? I know it's different for NS, and I have the IE code.
Thanks
-
04-23-2003, 02:08 PM #2Newbie
- Join Date
- Apr 2003
- Posts
- 15
for example your DIV has id=DivID
In IE4.0+ (DHTML DOM model) your code has to be like
document.all.DivID.innerText = 'Some new text to replace old one.'
In NS6.0+ and in IE5.0+ (W3C DOM) your code will look like
document.getElementById('DivID').innerText = 'Some new text to replace old one.'