Given the following HTML:
<form>
<input type="number" required>
</form>
The following javascript works fine:
(function( jQuery ) {
jQuery("input").bind("invalid", function(event) {
console.log(event.type);
});
})( jQuery );
But this javascript code does not:
(function( jQuery ) {
jQuery("form").on("invalid", "input", function(event) {
console.log(event.type);
});
})( jQuery );
Anyone got any idea why?
EDIT: Updated fiddle to correct one: http://jsfiddle.net/PEpRM/1