How to check if image loaded in the div the correct one
<p>I am relatively new to jQuery and any help would be much appreciated.</p>

<p>What i need is a <em>IF statement</em> to check whether the image loaded in the div is the "image1.jpg" or "image2.jpg" and perform the required action depending on the return from the if statement.</p>

<p>Here is the code i been trying to use:</p>

<pre><code>var image1 = $('&lt;img /&gt;').attr('src', 'images/branding_1_thumb.jpg');   
var image1_2 = $('&lt;img /&gt;').attr('src', 'images/branding_1_2_thumb.jpg');

if ($("#thumb2").length == image2_2.length) {
           /*action to perform*/
    }
    else {
       /*action to perform*/
}
</code></pre>

<p>I am not sure how i need to go about it. Do i need to pass the image paths as a strings and check that way?</p>

<p>Any help is much appreciated.</p>
