Saltar al contenido

JQUERY

javascript jquery radio button click

HTML JQUERY $(document).ready(function(){ $(«input[name=’payment_mode’]»).change(function(){ if( $(this).val() == «2» ){ $(«.payment_payment»).show(); }else{ $(«.payment_payment»).hide(); } }); }); Imagenes

get is checked checkbox

$(«#termsc»).on(«click», function(){ if( $(this).is(‘:checked’) ){ alert(«SI»); }else{ alert(«NO»); } })

Jquery stopPropagation

Ejemplo: $(«.carrito»).on(«click», function(event){ event.stopPropagation(); }); $(«#dialog_cart»).on(«click», function(){ closeCartHeader(); }); Créditos a: Sergio Melendez

jquery radio get value

Necesitamos obtener el ID de radio que vamos a seleccionar, entonces un segmento de código. $(«input[type=radio]»).on( «click», function(){ alert( $(this).val() ); });