Ver Mensaje Individual
  #2 (permalink)  
Antiguo 20/05/2015, 23:20
germangutierrez
 
Fecha de Ingreso: enero-2015
Mensajes: 43
Antigüedad: 9 años, 3 meses
Puntos: 3
Respuesta: Escoger primera posicion del select

solo pude con 2 bindings
uno para el onchange del select y otro para onclick del option
https://jsfiddle.net/8j5hodaa/2/

Código Javascript:
Ver original
  1. $( "#nivell option" ).click(function() {
  2.        
  3.                 if ( $( this ).val() !== "opcion1" && $( this ).val() !== "opcion2" ) {
  4.                     $( "#poblacion" ).hide();
  5.                 } else {
  6.                     $( "#poblacion" ).show();
  7.                    
  8.                 }
  9.      
  10.                 }
  11.             );
  12.  
  13. $( "#nivell" ).change(function() {
  14.     if ( $( this ).val() !== "opcion1" && $( this ).val() !== "opcion2" ) {
  15.     $("#nivell").val('opcion1')
  16.     }
  17. })