If I have a span, say:
hereismytext
How do I use JavaScript to change "hereism
In addition to the pure javascript answers above, You can use jQuery text method as following:
$('#myspan').text('newtext');
If you need to extend the answer to get/change html content of a span or div elements, you can do this:
$('#mydiv').html('new text');
References:
.text(): http://api.jquery.com/text/
.html(): http://api.jquery.com/html/