HTML onUnclick handler? [duplicate]

会有一股神秘感。 提交于 2021-01-27 12:21:20

问题


I want to trigger one handler when an input field is clicked, and another handler when it is deselected (i.e. if someone clicks outside of the field). Is there a way to accomplish this?

The click handler is simple enough:

<input onClick={props.clicked}>

Is it possible to create an "unclick" handler?


回答1:


I think onBlur event should be suitable for this



来源:https://stackoverflow.com/questions/64816941/html-onunclick-handler

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!