Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I simpler and clean coded way of achieving this would be to add a value="" to each item in the main that matches the ID of the corresponding tag you wish to show. You can view the working code here: <a href="http://jsfiddle.net/helpinspireme/HYkk3/1/" rel="nofollow">http://jsfiddle.net/helpinspireme/HYkk3/1/</a></p> <pre><code> &lt;script&gt; $('#mainselect').change(function() { var id = $(this).val(); if (id === 'makeChoice') { $('select').not('#mainselect').hide(); } else { $('#' + id).show(); $('select').not('#mainselect, #' + id).hide(); } });​ &lt;/script&gt; &lt;body&gt; &lt;td&gt; &lt;select id="mainselect" name="choice1"&gt; &lt;option value="makeChoice" selected="selected"&gt;Make a Choice&lt;/option&gt; &lt;option value="pcUpgrade"&gt;PC upgrade&lt;/option&gt; &lt;option value="system"&gt;System&lt;/option&gt; &lt;option value="network"&gt;Network&lt;/option&gt; &lt;/select&gt; &lt;/td&gt; &lt;td&gt; &lt;select name="pcUpgrade" id="pcUpgrade" style="display: none;"&gt; &lt;option&gt;Upgrade Set&lt;/option&gt; &lt;option&gt;Nieuwe voeding&lt;/option&gt; &lt;option&gt;Intern geheugen&lt;/option&gt; &lt;/select&gt; &lt;/td&gt; &lt;td&gt; &lt;select name="choice3" id="system" style="display: none;"&gt; &lt;option&gt;APK&lt;/option&gt; &lt;option&gt;Virus verwijderen&lt;/option&gt; &lt;/select&gt; &lt;/td&gt; &lt;td&gt; &lt;select name="choice4" id="network" style="display: none;"&gt; &lt;option&gt;Wi-Fi&lt;/option&gt; &lt;option&gt;Netwerk installatie&lt;/option&gt; &lt;/select&gt; &lt;/td&gt; &lt;/body&gt; </code></pre>
    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.
    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