Does anyone know if / how can I assign multiple events to a JQuery element on a single line?
For example:
$('#elemento')
.keyup(function(){...})
.focusout(function(){..});
Does anyone know if / how can I assign multiple events to a JQuery element on a single line?
For example:
$('#elemento')
.keyup(function(){...})
.focusout(function(){..});
The documentation for .on()
says:
Syntax:
.on events [ selector] [ data], callback )
and the event description says:
One or more space-separated event types
that is:
one or more event types separated by spaces.
An example would be:
$('#elemento').on('keyup focusout', function(){