+ 1
Can 1 button have 2 functions?
For example, 1 button has a function to save data and print receipts When clicking the button it immediately displays the receipt but the data is also stored in the table I saw on Google, 1 button can have 2 functions, but I don't know if it can work like this too I haven't tried it yet, because jreport/struct isn't working yet, still error, can't use jreport( receipt ) Please let me know, or if it doesn't work like this, please give me a suggestion This is about ordering a photo package (photography studio)
2 Réponses
+ 6
You can call many functions on a event of single button.
+ 1
You can add multiple event listeners to any element programmatically use the addEventListener method
button.addEventListener("click",func1);
button.addEventListener("click",func2);
on click of button both func1 and func2 will be called