lundi 28 décembre 2015

How to trigger two events together : onblur and onclick

I have an html code as below

    <input type="text" onblur="abc()">
    <button onclick="xyz()">

When the focus is on the input tag and I click on the button tag at the same time, two events must be triggered -

  1. onblur : abc() - because the input has lost focus.
  2. onclick : xyz() - because the button tag has got the click.

But instead only the abc() method is triggered. And when I click again on the button, the xyz() is triggered since the focus in now on the button tag.

Can anyone suggest me a method to trigger both the events together.




Aucun commentaire:

Enregistrer un commentaire