Reputation: 19969
I would like to detect when an input or textarea has recieved focus. For input I have:
$('body').on('focus','input', function(){
How would I add textarea to this? Tried
$('body').on('focus',['input','textarea'], function(){
but no dice
Upvotes: 1
Views: 38
Reputation: 240908
It should be:
$('body').on('focus', 'input, textarea', function () { ... });
Upvotes: 1