Javascript: Glitch with function
<p>I'm currently trying to make the function below work correctly. Recently added the IF ELSE variables to it, and after the my script no longer works. If I remove it of course, everything goes back to normal, minus that feature of course. What am I doing wrong exactly? Thanks in advance!</p>

<pre><code>var image3 = $("#image3");

$(function() {
 $("#ID-OF-LINK-1").click(function() {
        $("#image1").attr("src","./image1.jpg");
        $("#image2").attr("src","./image2.jpg");
            if (image3.src != "./image3.jpg"){
                ("#image3").attr("src","./image4.jpg"); }
            else
                ("#image3").attr("src","./image3.jpg"); }
  })

})
</code></pre>
