Ver Mensaje Individual
  #1 (permalink)  
Antiguo 23/12/2011, 03:40
Avatar de autonotel
autonotel
 
Fecha de Ingreso: junio-2003
Ubicación: Vigo
Mensajes: 480
Antigüedad: 20 años, 10 meses
Puntos: 13
Cannot read property 'style' of null

Hola tengo este código pero me da el error "Cannot read property 'style' of null"
He probado a cambiar el tipo de comillas con todas las combinaciones pero nada.
Quiero mostrar u ocultar el contenido del .
Código:

function verocultar() {
	 
          if(document.getElementById("div").style.display=='none') {
               document.getElementById("div").style.display==='block';
          } else {
               document.getElementById("div").style.display=='none';
          }
          return false;
     }


<select name="select" onchange="verocultar();">
<option....
</select>

<div id="div">el html</div>
Como siempre garcias