How to call multiple JavaScript functions in onclick event?
A link with 1 function defined
<a href="#" onclick="someFunc()">Click me To fire some functions</a>
Firing multiple functions from someFunc()
function someFunc() {
showAlert();
validate();
anotherFunction();
YetAnotherFunction();
}
onclick="doSomething();doSomethingElse();"
But really, you're better off not using onclick
at all and attaching the event handler to the DOM node through your Javascript code. This is known as unobtrusive javascript.