Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to filter options in a DropDownList using jQuery
    text
    copied!<p>I have 2 DropDownList.first DropDownList has 4 options.Second DropDownList has 20 options.I want when an option with <code>value = 1</code> selected in first DropDownList I show All Element in second DropDownList.and if an option with <code>value = 2</code> selected in first DropDownList I show some of second DropDownList options and So on. How I can do this using <code>jQuery</code></p> <p><strong>Edit 1)</strong></p> <p>Code is :</p> <pre><code>&lt;div&gt; &lt;asp:DropDownList ID="DropDownList1" runat="server" Height="72px" Width="184px"&gt; &lt;asp:ListItem Value="1"&gt;All&lt;/asp:ListItem&gt; &lt;asp:ListItem Value="2"&gt;Apples&lt;/asp:ListItem&gt; &lt;asp:ListItem Value="2"&gt;Orange&lt;/asp:ListItem&gt; &lt;asp:ListItem Value="3"&gt;Onion&lt;/asp:ListItem&gt; &lt;/asp:DropDownList&gt; &lt;br /&gt; &lt;asp:DropDownList ID="DropDownList2" runat="server" Height="18px" Width="187px"&gt; &lt;asp:ListItem Value="Apple_Style_1"&gt;Apple Style 1&lt;/asp:ListItem&gt; &lt;asp:ListItem Value="Apple_Style_2"&gt;Apple Style 2&lt;/asp:ListItem&gt; &lt;asp:ListItem Value="Apple_Style_3"&gt;Apple Style 3&lt;/asp:ListItem&gt; &lt;asp:ListItem Value="Orange_Style_1"&gt;Orange Style 1&lt;/asp:ListItem&gt; &lt;asp:ListItem Value="Orange_Style_2"&gt;Orange Style 2&lt;/asp:ListItem&gt; &lt;asp:ListItem Value="Orange_Style_3"&gt;Orange Style 3&lt;/asp:ListItem&gt; &lt;asp:ListItem Value="Orange_Style_4"&gt;Orange Style 4&lt;/asp:ListItem&gt; &lt;asp:ListItem Value="Onion_Style_1"&gt;Onion Style 1&lt;/asp:ListItem&gt; &lt;asp:ListItem Value="Onion_Style_2"&gt;Onion Style 2&lt;/asp:ListItem&gt; &lt;/asp:DropDownList&gt; &lt;/div&gt; </code></pre>
 

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