title: show/hide select html5 javascript
body: <p>i search in this forum and and tried different ways explained right here ,i tried everything but i have this problem, as you can see i tried diferent ways, the function show me the alert....but does't hide or show anything, and i don't know why :/</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
  
  function show(valor) {
    var zona1=document.getElementById("zona");
    var b=document.getElementById("barrioscf");
    var part=document.getElementById("partidos");
  
    if (valor==1) {
      /* b.style.visibility='visible';
         part.style.visibility='hidden';
      */
      b.style.display = 'block';
      part.style.display = 'none';
  
      alert ("entro if 1");
      //document.all.form_crea.barrioscf.style.visibility="visible"
      //document.all.form_crea.p.style.visibility="hidden"
  
    } else if(valor==2) {
      b.style
      b.style.display = 'none';
      part.style.display = 'block';
  
      alert ("entro if 2");
  
      /* b.style.visibility="hidden";
         part.style.visibility="visible";*/
      //document.all.form_crea.barrioscf.style.visibility="hidden"
      //document.all.form_crea.p.style..visibility="visible"
    }
  }
  &lt;/script&gt;
  
  
  &lt;select id="zona" name="zona_nombre" 
   onChange="javascript:mostrar_barrios(this.value);"&gt;
    &lt;option value="1"&gt;Capital Federal&lt;/option&gt;
    &lt;option value="2"&gt;Gran Buenos Aires&lt;/option&gt;
  &lt;/select&gt;
  
  &lt;tr&gt;&lt;td&gt;Barrios:
    &lt;td&gt;
      &lt;select id="barriocf"name="barriocf" &gt;
        &lt;?
          while ($row = mysql_fetch_row($result)) { 
            echo "&lt;option value='".$row['0']."'&gt;".$row['1']."&lt;/option&gt;";
          } 
          mysql_free_result($result); 
        ?&gt; 
      &lt;/select&gt;
  &lt;tr id="partidos"&gt;
    &lt;td&gt;Partidos:
    &lt;td&gt;
      &lt;select id="p"name="partido" style="visibility:hidden"&gt;
        &lt;option value="Avellaneda"&gt;Avellaneda&lt;/option&gt;
      &lt;/select&gt;       
  </code></pre>