This question already has an answer here:
HTML & JS
How do I call 2 functions from one onclick event? Here's my code
<input id ="btn" type="button" value="click" onclick="pay() cls()"/>
the two functions being pay() and cls(). Thanks!
This question already has an answer here:
HTML & JS
How do I call 2 functions from one onclick event? Here's my code
<input id ="btn" type="button" value="click" onclick="pay() cls()"/>
the two functions being pay() and cls(). Thanks!
Just to offer some variety, the comma operator can be used too but some might say "noooooo!", but it works:
http://jsbin.com/oqizir/1/edit
Try this
however, if you're using a return statement in "pay" function the execution will stop and "cls" won't execute,
a workaround to this: