Note that there are some explanatory texts on larger screens.

plurals
  1. POWhy didn't show element inside the <div> if a value is selected in drop down box?
    primarykey
    data
    text
    <p>I just wonder why the element inside the didn't show up if a value is selected in drop drown box?But it is work fine in JSFiddle :<a href="http://jsfiddle.net/ca4Es/" rel="nofollow noreferrer">JSFiddle</a></p> <p>Below show how my HTML code and Jquery script work in my own system:</p> <pre><code>&lt;tr&gt; &lt;th class="title"&gt;Registration&lt;/th&gt; &lt;td&gt; : &lt;/td&gt; &lt;th&gt;&lt;select name="reg" id="registration"&gt; &lt;option value="No"&gt;No&lt;/option&gt; &lt;option value="Yes"&gt;Yes&lt;/option&gt; &lt;/select&gt; &lt;/th&gt; &lt;/tr&gt; &lt;div id="opt" style="display:none;"&gt; &lt;tr&gt; &lt;th class="title"&gt;Participant&lt;/th&gt; &lt;td&gt; : &lt;/td&gt; &lt;th&gt;&lt;input type="text" name="participant"&gt;&lt;/th&gt; &lt;/tr&gt; &lt;tr&gt; &lt;th class="title"&gt;Payment Amount&lt;/th&gt; &lt;td&gt; : &lt;/td&gt; &lt;td&gt;&lt;input type="text" name="amount"&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;th class="title"&gt;Payment Method&lt;/th&gt; &lt;td&gt; : &lt;/td&gt; &lt;td&gt;&lt;input type="radio" name="pay_method" value="CC"&gt;Credit Card &lt;input type="radio" name="pay_method" value="Counter"&gt;Counter &lt;/td&gt; &lt;/tr&gt; &lt;/div&gt;&lt;!--end of the opt--&gt; </code></pre> <p>Jquery script:</p> <pre><code>&lt;script type="text/javascript"&gt; $(document).ready(function(){ $("#registration").change(function(){ if($(this).val()=="Yes"){ $("#opt").show(); }else { $("#opt").hide(); } }); }); &lt;/script&gt; </code></pre> <p>The sample output as below: <img src="https://i.stack.imgur.com/wxShu.png" alt="enter image description here"> </p> <p>Supposed when the value No is selected,it will not showing anything,</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.
    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