I know I'm doing something silly. But I just can't figure it out. I want to replace some text inside an tag immediately when the document loads. I know the function is executing. But it konks out at the getElementById statement and I don't know why. The output should say "New Junk". But instead always says "Original Stuff".
<html>
<script>
window.onload = filltip();
function filltip() {
alert('xyz');
var id = 'qourl';
var txt = 'New Junk';
//alert('current html=' + document.getElementById(id).innerHTML);
document.getElementById(id).innerHTML = '?<span class="classic">' + txt +
'</span>';
}
</script>
<body>
<a href='#' id='qourl'>Original Stuff</a>
</body>
</html>