Say I programmatically set focus on a textarea with a simple document.getElementById('myTextArea').focus();. On that textarea I have an onFocus event:
document.getElementsByName('myTextArea')[0].onFocus = function () {
alert('I’m focused!');
};
I only want that onFocus to be fired when the user actually focuses on the textarea and not when I set focus programmatically.
Is there a way in the onFocus to tell if the event was triggered by code or by a human, without passing in a parameter of my own?