Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Your img tags has an ID="hide" instead of CLASS="hide".</p> <pre><code>WRONG: &lt;img src="../../Content/Images/downarrow.gif" title="Hide Details" id="hide"&gt; GOOD: &lt;img src="../../Content/Images/downarrow.gif" title="Hide Details" class="hide"&gt; $(".hide") - this one selects all elements with class="hide" </code></pre> <p><strong>UPDATE:</strong></p> <p>Also, you have multiple LI tags with the same ID="list": <code>&lt;li id="list"&gt;</code> You have to use a class: <code>&lt;li class="list"&gt;</code></p> <p>The difference between an ID and a class is that an ID can be used to identify one element, whereas a class can be used to identify more than one.</p> <p><strong>SOLUTION:</strong></p> <pre><code>&lt;li class="list"&gt; &lt;table cellpadding="0" cellspacing="0" width="100%" class="grid-table08" id="table1"&gt; &lt;tbody&gt; &lt;tr&gt;&lt;td&gt;&lt;img src="../../Content/Images/downarrow.gif" title="Hide Details" class="hide"&gt; &lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;td align="left" valign="top" width="15" nowrap="nowrap"&gt; Hii good morning &lt;/td&gt; &lt;tr&gt; &lt;/table&gt; &lt;/li&gt; &lt;li class="list"&gt; &lt;table cellpadding="0" cellspacing="0" width="100%" class="grid-table08" id="table1"&gt; &lt;tbody&gt; &lt;tr&gt;&lt;td&gt;&lt;img src="../../Content/Images/downarrow.gif" title="Hide Details" class="hide"&gt; &lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;td align="left" valign="top" width="15" nowrap="nowrap"&gt; Hii good evening &lt;/td&gt; &lt;tr&gt; &lt;/table&gt; &lt;/li&gt; &lt;/ul&gt; </code></pre> <p>and</p> <pre><code>$(function () { $(".hide").live("click", function () { $(this).parents("li.list:first").hide("slow"); }); }); </code></pre> <p>Try the demo here: <a href="http://jsfiddle.net/RtXn9/" rel="nofollow">http://jsfiddle.net/RtXn9/</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