i want to get know within onchange
event handler, which control caused change (or blur) event.
i tried to use jQuery $(":focus")
for that aim, but
$('.some_class').change(function (e) {
console.log(e.target);
console.log($(':focus').get(0)); // always `undefined`.
/* ......... other code......... */
});
$('.some_class').change(function (e) {
console.log(e.target);
console.log($(':focus').); // just remove the .get(0)
}); remove the .get(0),you can get the element which is on focus
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With