function runs all conditionals, ignores current variables
<p>I created some divs; their innerHTML properties get changed according to the current image shown (defined by <code>imageArray[value]</code>). The problem I have is that conditionals in this function do not work as they should. This function runs every statement and stops at the values in the last conditional bracket. It could be a logic issue or a missing piece of code, but I would like to have your thoughts on how this problem can be solved.</p>

<p>This function gets triggered through <code>prevImage()</code> or <code>nextImage()</code>:</p>

<pre><code>function textChange(){

var titleMod = document.getElementById('title');
var dateMod = document.getElementById('date');
var infoMod = document.getElementById('info');
var pagelink = document.getElementById('enter');

if(new_image = imageArray[0]){

    titleMod.innerHTML = "This is Image 1";
    dateMod.innerHTML = "july 12 12";
    infoMod.innerHTML = "&lt;p&gt;paragraph goes in here&lt;/p&gt;";
    pagelink.onclick = "window.location.href='house.html';"

    alert('\o/');

    }

if(new_image = imageArray[1]){

    titleMod.innerHTML = "This is Image 2";
    dateMod.innerHTML = "july 12 19";
    infoMod.innerHTML = "&lt;p&gt;paragraph&lt;/p&gt;";
    pagelink.onclick = "window.location.href='contact.html';"

    alert('lolol');

    }

if(new_image = imageArray[2]){

    titleMod.innerHTML = "This is Image 3";
    dateMod.innerHTML = "july 12 19";
    infoMod.innerHTML = "&lt;p&gt;paragraph&lt;/p&gt;";
    pagelink.onclick = "window.location.href='contact.html';"

    alert('thisWorks');

    }

}
</code></pre>
