I've got a focusout event where if the relatedTarget of the event was a button with one id I was doing some actions. I've recently seen that relatedTarget's value in FF and safari is always null so my code is not crossbrower and not valid for my purpose. Is there any crossbrowser way to know what is the new focused element in a focusout event?
My old code:
$(document).on('focusout', 'myclass', function (e) {
if ($(e.relatedTarget).attr('id') == 'mybutton') {
prevElem = $(this);
}
else {
prevElem = "";
}
}
Thanks in advance