开发者

Event handling when onclick

开发者 https://www.devze.com 2023-03-10 18:25 出处:网络
I have an onclick handler for a button. When user clicks on it onBlur() is called on currently focused element rather on the button user just clicked.

I have an onclick handler for a button. When user clicks on it onBlur() is called on currently focused element rather on the button user just clicked.

Now I am handling blur as well. While handling blur I realized I dont want to execute onclick handler at all.

How can I do that?

Let me know if information provide开发者_如何学JAVAd is insufficient.

Thanks in advance.


I would set a variable during the onblur function called blurring or something similar that is true at the beginning, then false after finishing onblur. In the onclick handler check if the blurring is true, if not then do stuff, otherwise do nothing.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号