title: How to assign the option value from a dropdown to select id of another dropdown?
body: <p>I have a long select dropdown menu. On click on each option another dropdown should display. This is a sample html code. So, when I select section1,  selction will appear with section1 id and when i click on section2, section2 dropdwon will be displayed.</p>
  
  <pre><code>&lt;select id="section_id" name="section"&gt;
  &lt;option&gt;--Select -&lt;/option&gt;
  &lt;option value="section1"&gt;section1&lt;/option&gt;
  &lt;option value="section2"&gt;section2&lt;/option&gt;
  &lt;/select&gt;
  
  &lt;select id="section1" name="sub_section"&gt;
  &lt;option&gt;--Select -&lt;/option&gt;
  &lt;option value="section1"&gt;subsection&lt;/option&gt;
  &lt;option&gt;subsection&lt;/option&gt;
  &lt;/select&gt;
  &lt;select id="section2" name="sub_section1"&gt;
  &lt;option&gt;--Select -&lt;/option&gt;
  &lt;option value="section1"&gt;section&lt;/option&gt;
  &lt;option&gt;section&lt;/option&gt;
  &lt;/select&gt;
  
  
  My js code:
  
  $(document).ready(function(){
              $("#section_id").change(function(){
              var v = $(this).val();
              var y = document.getElementById(var);
               if (if (v==y)){
                  $("#" + y).show();
               }
               else{
                  $("#" + y).hide();
               }
              });
          }); 
  </code></pre>