Menu
I’ve written a little function for the mouseover so that a button can change colour in IE. Only thing is, Mozilla doesn’t recognise the style property and gives a javascript error. How do I get my code to not execute if the property is not supported? The if statement that I’m using isn’t working.
[code]
<input name=”target1″ class=”myClass” type=”submit” onMouseOver=”doMouseOver(‘target1’);” value=”hello”/>
[code]
function doMouseOver(srcName)
{
srcObj=document.getElementById(srcName);
if (srcObj.style) {
srcObj.style.backgroundColor = “#ffcc00”;
}
}