+ 2
Is it possible to assign 2 functions to a single button??
2 ответов
+ 10
Short answer is yes and the proper way would be saying attaching 2 event listeners to the button.
If it's for a same event (e.g. onClick), perhaps you can wrap it into a single function and call any number of functions inside it. 😉
+ 2
Yes, it is possible to call two function with one single button.
Assume you have 2 function a() and b(). Therefore, you can use them like this :-
<button onclick="a();b();">Calling<button>