switch images using javascript
<p>I am trying to switch these pictures by clicking.  The javascript came straight from mozilla tutorial, so I am not sure why it does not work, nothing happens at all.  I am developing in cloud9.</p>

<p>My HTML:</p>

<pre><code>&lt;img id="swagBunny" src="images/large.jpg" height="150" width="186" alt="Swaggy Bunny"/&gt;
</code></pre>

<p>My Java Script:</p>

<pre><code>var myImage = document.querySelector('img');

$(function(){ 
   myImage.onclick = function() {
        var mySrc = myImage.getAttribute('src');
        if(mySrc === 'images/large.jpg') {
            myImage.setAttribute ('src','images/images.jpg');
         } else {
            myImage.setAttribute ('src','images/large.jpg');
         }
   };
});
</code></pre>