Possible Duplicate:
javascript - document.write error?
I have a piece of Javascript that I'm using that checks to see if a div is a certain style and then runs an if else statement:
window.onload = function () {
if (document.getElementById('slidingDiv').style.display == 'none') {
document.write('<a href="#show" class="show_hide"><img src="images/show-more-arrow.jpg" width="61" height="45"></a>');
} else {
document.write('<a href="#show" class="show_hide"><img src="images/show-less-arrow.jpg" width="61" height="45"></a>');
}
};
This works OK, but it only shows this HTML image on the screen. I need it to add the HTML to the existing code on the page.
Many thanks