By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,474 Members | 1,273 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,474 IT Pros & Developers. It's quick & easy.

Changing <SPAN... with JS ?

P: n/a
Hello everyone,

It's possible to change the XXX in this statement with JS?

<span id="myspan" class="standard-text">XXX</span>

Thanks very much

Jul 20 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Jeff wrote on 11 okt 2003 in comp.lang.javascript:
Hello everyone,

It's possible to change the XXX in this statement with JS?

<span id="myspan" class="standard-text">XXX</span>


document.getElementById("myspan").innerHTML = "with JS"

;-)

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Jul 20 '05 #2

P: n/a
DU
Evertjan. wrote:
Jeff wrote on 11 okt 2003 in comp.lang.javascript:
Hello everyone,

It's possible to change the XXX in this statement with JS?

<span id="myspan" class="standard-text">XXX</span>


document.getElementById("myspan").innerHTML = "with JS"

;-)

document.getElementById("myspan").firstChild.nodeV alue = "with JS";
is faster, more efficient, is very well supported by current browsers
and is entirely compliant with DOM 2.

innerHTML versus nodeValue performance comparison
http://www10.brinkster.com/doctorunc...NodeValue.html

DU
--
Javascript and Browser bugs:
http://www10.brinkster.com/doctorunclear/
- Resources, help and tips for Netscape 7.x users and Composer
- Interactive demos on Popup windows, music (audio/midi) in Netscape 7.x
http://www10.brinkster.com/doctorunc...e7Section.html

Jul 20 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.