Note that there are some explanatory texts on larger screens.

plurals
  1. POJquery select div in a row
    text
    copied!<p>Hiya all, I'm really stuck .. I need urgent advice :D here is my html :</p> <pre><code>&lt;!-- Beginning of ROW !--&gt; &lt;div id="row1"&gt; &lt;div id="entry"&gt; free &lt;span&gt;some text&lt;/span&gt; &lt;p&gt;DKK&lt;/p&gt; &lt;input type="radio" name="red&lt;% Response.Write(counter); %&gt;" id="radio" value="0" /&gt; &lt;/div&gt; &lt;div id="entry"&gt; week &lt;span&gt;&lt;/span&gt; &lt;p&gt;DKK&lt;/p&gt; &lt;input type="radio" name="red&lt;% Response.Write(counter); %&gt;" id="radio2" value="75" /&gt; &lt;/div&gt; &lt;/div&gt; &lt;!-- End of ROW !--&gt; &lt;!-- Beginning of ROW !--&gt; &lt;div id="row2"&gt; .... same as in row 1 &lt;/div&gt; &lt;!-- End of ROW !--&gt; nth row .. </code></pre> <p>Here is Jquery :</p> <pre><code>$("input").click(function() { $("input").parent("div").css("background", "url(images/div_bg.png)"); $(this).parent("div").css("background", "url(images/div_bg_hover.png)"); }); </code></pre> <p>What I'm trying to do .. is when I select a radio input the div in which it is located should change background and it works perfectly if there is only one row, but for instance if I try to select the value in first row then I select value in second row.. the div in second row where radio input is located changes background as it should but the div in first row reverse itself to other background although input remained checked .. here is what I'm trying to achieve</p> <p><a href="http://i26.tinypic.com/34ythlj.png" rel="nofollow noreferrer">alt text http://i26.tinypic.com/34ythlj.png</a></p> <p>And here is what I achieve :</p> <p><a href="http://i31.tinypic.com/24pweau.jpg" rel="nofollow noreferrer">alt text http://i31.tinypic.com/24pweau.jpg</a></p>
 

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