How to call multiple JavaScript functions in onclick event?

Qcom picture Qcom · Oct 12, 2010 · Viewed 692k times · Source

Is there any way to use the onclick html attribute to call more than one JavaScript function?

Answer

brad picture brad · Oct 12, 2010
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.