Pretty simple function here but not working. Just started with Javascript so be gentle with me. Also does anyone know of any good community forums for beginners. I feel this is such a simple question to ask on here, but maybe not.
<html>
<head>
<script type="text/javascript">
var img;
function mouseOver()
{
alert(img);
img.src ="button_over.jpg";
}
function mouseOut()
{
img.src ="button_out.jpg";
}
function init()
{
img = document.getElementById("buttonWrapper").getElementsByTagName('img')[0];
}
</script>
</head>
<body onLoad="javascript:init()">
<div id="buttonWrapper">
<img border="0" src="button_out.jpg" width="62" height="74" onmouseover="mouseOver()" onmouseout="mouseOut()" / >
</div>
</body>
</html>