Here is what I want to do:
I have some buttons in my page, onmouseover I want it to change color and then onmouseout to return to original BUT if I click on them I want them to change to a different color and stay like that.
The button:
[CODE]
<button id=”original” onmouseover=”changeIt(this);” onmouseout=”this.style.background=””; onclick=”goToOriginal(this);”>Home</button>
The functions:
[CODE]function changeIt(ob){
ob.style.background=’purple’;
}
function goToOriginal(ob){
ob.detachEvent(‘onmouseover’,changeIt(ob));
ob.style.background=’red’;
}
Also in IE afte mouseover and mouseout the background color of my button will switch to the one the div that contains it has and will remain like that :S