title: javascript mouseOver code
body: <p>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.</p>
  
  <pre><code>&lt;html&gt;
  &lt;head&gt;
  &lt;script type="text/javascript"&gt;
  
  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];  
  }
  &lt;/script&gt;
  &lt;/head&gt;
  
  &lt;body onLoad="javascript:init()"&gt;
      &lt;div id="buttonWrapper"&gt;
          &lt;img border="0" src="button_out.jpg" width="62" height="74" onmouseover="mouseOver()" onmouseout="mouseOut()" / &gt;
      &lt;/div&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>