Uncheck radio button con jQuery
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
</head>
<input type="radio" name="opt1" value="Opcion1">Opcion1</input>
<input type="radio" name="opt1" value="Opcion2">Opcion2</input>
<script>
$(document).ready(function() {
$("[name=opt1]").mousedown(function(event) {
if ( $(this).prop('checked') )
$(this).prop('checked', false);
else
$(this).prop('checked', true);
event.preventDefault();
});
$("[name=opt1]").click(function(event) {
event.preventDefault();
});
});
</script>
</html>
Suscribirse a:
Enviar comentarios (Atom)
No hay comentarios:
Publicar un comentario