HTML Code:
<SCRIPT type="text/javascript">
var k=''
k+='documentWrite any html with tags. ';
k+='Note how I use single quotes here. ';
k+='This way, as you normally would write html ';
k+='with double quotes around attributes, no need to escape them or break your habit.';
k+='<DIV id="aDiv"><img src="anImage.jpg"> See?</DIV>';
k+='to destroy the image, only need to set the innerHTML of the div to"" <br>';
k+='<input type=button onclick="document.getElementById(\'aDiv\').innerHTML=\'\'"" value="imageGoAway"><P>';
k+='If you over-use this method of innerHTML, some browsers are likely to crash. ';
k+='You should look up and study <I>DOM Elements Object</I> for the other methods ';
k+='such as <i>appendChild()</i> and <i>removeChild()</i>'
document.write(k)
</SCRIPT>
Bookmarks