Two trigger to one function ? [keyup and focusout]
You can use .bind()
which takes a space separated list of events to bind your handler to, like this:
$('#myfield').bind("keyup focusout", function () {
//do something
});
Though, unless you need some special propagation, I'd stick with blur
over focusout
, just a preference really:
$('#myfield').bind("keyup blur", function () {
//do something
});