views:

544

answers:

2

If I have a span, say:

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

How do I use javascript to change "hereismytext" to "newtext"

+5  A: 

document.getElementById("myspan").innerHTML="newtext";

Gregoire
Wow, you beat me by one second
Dan
+1  A: 

document.getElementById('myspan').innerHTML = 'newtext';

Dan