title: Dropdownlist Onchange Show other Dropdownlist
body: <p>My problem is I want to create a category selecting system with javascript but when I choose an option it displays all divs; it should show only one div. </p>
  
  <p>For example : <code>if value = emlak</code> then <code>show div id=emlak</code></p>
  
  <hr>
  
  <h2>JS</h2>
  
  <pre><code>function getData(dropdown) {
   var value = dropdown.options[dropdown.selectedIndex].value;
   if (value = 'emlak'){
    document.getElementById("emlak").style.display = "block";
   }
   if(value = 'vasita'){
    document.getElementById("vasita").style.display = "block";
   }
  }
  </code></pre>
  
  <h2>HTML</h2>
  
  <pre><code>&lt;select name="kategori" onChange="getData(this);"&gt;
       &lt;option value="hat" onClick=""&gt;Hat&lt;/option&gt;
       &lt;option value="emlak"&gt;Shirt&lt;/option&gt;
       &lt;option value="vasita"&gt;Pants&lt;/option&gt;
  &lt;/select&gt;
  &lt;select id="emlak" name="currentList" onChange=";" style="display:none;"&gt;
       &lt;option value="hat"&gt;Hat&lt;/option&gt;
       &lt;option value="emlak"&gt;Shirt&lt;/option&gt;
       &lt;option value="pants"&gt;Pants&lt;/option&gt;
  &lt;/select&gt;
  &lt;select id="vasita" name="currentList" onChange="" style="display:none;"&gt;
       &lt;option value="hat"&gt;Otomobil&lt;/option&gt;
       &lt;option value="emlak"&gt;Shirt&lt;/option&gt;
       &lt;option value="pants"&gt;Pants&lt;/option&gt;
  &lt;/select&gt;
  </code></pre>