When I click a button, with the onClick function, I replace an image with another one. The code is this
<a class="blue_button" onClick="javascript:loading.style.display='block';zip.style.visibility='hidden';"
href="javascript:getsupport('zip')" id="download">
<img id="zip" src="img/zip.png">
<img id="loading" src="img/loading.gif">
</a>
in the css I have this:
.blue_button{
display:block;
height:30px;
margin-right:20px;
float:left;
width:110px;
color:#FFF;
font-size:12px;
border-radius:4px;
padding:0 23px 0 20px;
}
.blue_button img{
position:relative;
top:5px;
margin-right:7px;
}
.blue_button img#loading{
display:none;
float:left;
top:-17px;
}
it works in every browsers, exept IE9. If I active the Compatibility mode it works, but I need to maintain the standard mode.
== SOLVED == using unobtrusive js. Thanks to all
window.onload = loading;
function loading()
{
document.getElementById('download').onclick = function()
{
document.getElementById('zip').style.visibility = 'hidden';
document.getElementById('loading').style.display = 'block';
}
}