javascript - How I can set drop down menu set when click on check box? -


i want set drop down menu . when click on check-box physics open sub category. other wise not open.here code.. want set menu in table form..any 1 can me..tell me how can set jquery.

<table >  <tr>          <td valign="top">disciplines :</td>          <td><table>              <tr>                         <td width="30"><input type="checkbox" name="physics" /></td>                <td width="200">physics                <table style="display:none;">              <tr>                <td width="30"><input type="checkbox" name="acoustics" /></td>                <td width="200">acoustics</td>                 </tr>                    <tr>                <td width="30"><input type="checkbox" name="cosmology" /></td>                <td width="200">cosmology</td>                 </tr>                    <tr>                <td width="30"><input type="checkbox" name="nuclear physics" /></td>                <td width="200">nuclear physics</td>                 </tr>            </table>                                            <td width="30"><input type="checkbox" name="chemistry" /></td>                <td width="200">chemistry                <table style="display:none;">              <tr>                <td width="30"><input type="checkbox" name="chromatography" /></td>                <td width="200">chromatography</td>                 </tr>                    <tr>                <td width="30"><input type="checkbox" name="catalysis" /></td>                <td width="200">catalysis</td>                 </tr>                    <tr>                <td width="30"><input type="checkbox" name="geochemistry" /></td>                <td width="200">geochemistry</td>                      </tr>            </table>                 </tr>            </table>                </td>                                    </tr>                                                                      </table>              </td>        </tr>  </table>

i hope work you

$('input[name="physics"]').on('click', function() {     $('.physicstable').slidetoggle(); })  $('input[name="chemistry"]').on('click', function() {     $('.chetable').slidetoggle(); }) 

working demo


Comments

Popular posts from this blog

android - MPAndroidChart - How to add Annotations or images to the chart -

javascript - Add class to another page attribute using URL id - Jquery -

firefox - Where is 'webgl.osmesalib' parameter? -