Which event should I use for any kind of button activation:
Do I need to define three event handlers or can I do this with just one?
The question aims plain JavaScript without any library use.
And what happens, when W3C invents a new event, which recognizes fart sounds to activate a button? Do I have to add a fourth event handler?
It depends on what action you want after the event is done.If you have a submit button then use mouse events like:
onclick event - this activates whenever you click the left button on your mouse
oncontextmenu - this is activated when the right button of the mouse is clicked
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.