preventDefault () no funciona para evento de cambio
¿Alguna idea de por qué preventDefault no funciona? Aquí está el código a continuación. . . Tks!
<head>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js">
$(document).ready(function() {
$("#text1").change(function(e) {
e.preventDefault();
});
});
function myFunc() {
alert("Random, annoying alert");
}
</script>
</head>
Solo un elemento HTML en el formulario:
<body>
<form name="test" method="post">
<input name="text1" id="text1" type="text" onchange="myFunc();">
</form>
</body>