jQuery Supports HTML5 Events
HTML
<form>
<input type="number" required>
</form>
to trigger the invalid event: enter the cursor to the text field. type nothing, hit enter.
type anything for the input event
right click for the contextmenu event
JavaScript
(function( jQuery ) {
/*
jQuery("form").on("invalid", "input", function(event) {
console.log(event.type);
});
*/
jQuery("input").bind("invalid", function(event) {
console.log(event.type);
});
})( jQuery );
//tests