Best way to replace image buttons in jquery
<p>Below I have an image button:</p>

<pre><code>&lt;table id="question"&gt;
&lt;tr&gt;
&lt;td colspan="2"&gt;
&lt;a onclick="return plusbutton();"&gt;
&lt;img src="Images/plussign.jpg" width="30" height="30" alt="Look Up Previous Question" class="plusimage" id="mainPlusbutton" name="plusbuttonrow"/&gt;
&lt;/a&gt;
&lt;span id="plussignmsg"&gt;(Click Plus Sign to look up Previous Questions)&lt;/span&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
</code></pre>

<p>Now what I want to do is by using jquery I want to hide the current image <code>Images/plussign.jpg</code> and replace with another image <code>Images/plussigndisabled.jpg</code> in the if statement below:</p>

<pre><code>if (qnum == &lt;?php echo (int)$_SESSION['textQuestion']; ?&gt;) {

}
</code></pre>

<p>And then in the document ready function I want it to replace the <code>Images/plussigndisabled.jpg</code> with <code>Images/plussign.jpg</code></p>

<p>I want to know what is the best way to achieve this in jquery?</p>

<p>UPDATE:</p>

<p>Below is what I tried:</p>

<pre><code>var x = "&lt;img src='Images/plussigndisabled.jpg' width='30' height='30' alt='Look Up Previous Question' class='plusimage' name='plusbuttonrow'/&gt;&lt;span id='plussignmsg'&gt;(Click Plus Sign to look &lt;br/&gt; up Previous Questions)&lt;/span&gt;" ;

    if (qnum == &lt;?php echo (int)$_SESSION['textQuestion']; ?&gt;) {


     $('#plus th').html($(x)); 

        $("#showGridId").unbind('click').click(function (event) {
        event.preventDefault();
        return false;
    }).css('color', '#BBBBBB');
}
</code></pre>

<p>Thanks</p>
