The element that you are triggering the event should not listen to this event, since the potentially parent element can also listen to this event.
, , . , focus , ( focus()), submit ( submit()), , , .. , , .
, fireEvent(), IE. , dispatchEvent fireEvent , dispatchEvent , fireEvent .
test.onfocus = function(event) {
console.log('focused');
if( ! test.hasFocus() ) {
test.focus();
}
}