I want to know if the focus event is triggered programtically or by human ?
I am writing the part of the script
jQuery( document ).on( 'focus', '#song_artist_focus', function(event) {
if(event.originalEvent === undefined ){
alert('I am not human');
return;}
alert('I am human') ;
});
And when i call this script programtically like this
jQuery('#song_artist_focus').focus();
It still shows that event is triggred by human. Please help ?
UPDATE
I checked this solution Check if event is triggered by a human. But doesn't work on focus events.