Instead of using the onclick attribute, you should use event handlers.
<input id="score-button" type="button" value="Get Score">
Then in javascript ...
var scoreButton = document.getElementById('score-button');
scoreButton.addEventListener('click', myFuncOne(), false);
scoreButton.addEventListener('click', myFuncTwo(), false);
Of course, as mentioned in other sentences, you really should use a javascript library such as jQuery, which provides many tools to make your life easier.
In jQuery, the above code may be shorter ...
$('#score-button').click(function() {
myFuncOne();
myFuncTwo();
});
source
share