Note that there are some explanatory texts on larger screens.

plurals
  1. POChanging pictures with javascript
    primarykey
    data
    text
    <blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="https://stackoverflow.com/questions/6568424/changing-the-img-src-with-jquery">changing the img src with jquery</a> </p> </blockquote> <p>The title may make this sound easy, and it probably is. but i, with my incredibly small knowledge of js, am finding it incredibly nerve wracking... basically i have pictures set in a form (lets say img1 img2 and img3) and i want the user to be able to click on an image and it will change to a different one, for instance you click on img1 and it becomes img1a. and etc, heres the code:</p> <pre><code>&lt;form&gt; &lt;p align="center"&gt; &lt;input type="checkbox" name="interest1" id="interest1" value="x"&gt; &lt;input type="checkbox" name="interest2" id="interest2" value="x"&gt; &lt;input type="checkbox" name="interest3" id="interest3" value="x"&gt;&lt;/p&gt; &lt;p align="center"&gt; &lt;label for="interest1" id="label-interest1"&gt;&lt;img src="/images/img1.jpg" width="781" height="800" /&gt;&lt;/label&gt; &lt;label for="interest2" id="label-interest2"&gt;&lt;img src="/images/img2.jpg" width="781" height="800" /&gt;&lt;/label&gt; &lt;label for="interest3" id="label-interest3"&gt;&lt;img src="/images/img3.jpg" width="781" height="800" /&gt;&lt;/label&gt;&lt;/P&gt;&lt;!-- code making checkbox be an image--&gt; &lt;/form&gt; </code></pre> <p>there are currently checkboxes, however those will be hidden, so i need the images to change on click to show the user that it is in fact selected, any ideas guys?</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload