Selecting the first img from div
<p>I have the following html. </p>

<pre><code>&lt;div&gt;
   &lt;img class="foo"&gt;
   &lt;a href="#" onClick="changeImage(this, param1, param2)"&gt;sth&lt;/a&gt;
&lt;/div&gt;
</code></pre>

<p>I want to change the class of image (remove <code>foo</code>, add <code>bar</code>) when user clicks on the link. However, I cannot write down the right selector for jquery. </p>

<p>I am also not sure if I really need to pass the <code>this</code> to the function.</p>

<pre><code>function changeImage(link, param1, param2) {

    //Following line does not work
    $(link).parent('div img').removeClass("foo").addClass("bar");

}
</code></pre>
