For example I need to execute some function when onblur/onfocus event is processed (one element has lost focus and other has taken focus).
To be more specific I have something like the following.
<div id="foo" tabIndex="1" onblur="document.getElementById('bar').style.display = 'none';">foo</div>
<div id="bar" tabIndex="2" onclick="alert('bar');">bar</div>
<div>stuff</div>
Let's suppose element 'foo' is focused. When 'foo' loses focus I should hide element 'bar'. But if I click on 'bar' I should see alert. It doesn't work because after event onblur is processed then element 'bar' is invisible, and neither onclick nor onfocus occur.