I know how to replace text with getElementById() function in such situation:
<script type="text/javascript">
function go(){
var p = document.getElementById('ccc');
p.firstChild.nodeValue = 'AAA';
}
</script>
<div id='ccc'>o</div>
<a href="javascript:go()">go</a>
When I click on go link ‘o’ replaces on ‘AAA’.
But I want to replace text when page loading to browser without any clicking. So user do not have to know that there was some text ‘o’ in div ‘ccc’. He must see only ‘AAA’ from the beginning.
How to do that?
use onload attribute like this:
<body onload="go()">