user105033 user105033 - 1 year ago 90
HTML Question

How do I change the text of a span element in JavaScript

If I have a span, say:

<span id="myspan"> hereismytext </span>

How do I use JavaScript to change "hereismytext" to "newtext"?

Answer Source

EDIT For modern browsers :

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download