Reputation: 1
I have my html set up and my javascript functions ready but I can't get it to run both at the same time only one runs once I click the button. I'm using the Jade template engine with Node.js and this is what I have so far:
input(type = 'button' value = 'Calcular' onClick = "calculateComission()""calcMonthlyPay()")
Upvotes: 0
Views: 989
Reputation: 75
input(type = 'button' value = 'Calcular' onClick = "calculateComission();calcMonthlyPay()")
Does this work?
Upvotes: 0
Reputation: 262
onClick="calculateComission();calcMonthlyPay();"
But this is pretty bad. You usually don't want to bind functions inline like that, especially for more complex logic like this. You should probably make a function that calls the other two and bind that, or better bind the event listener in code on page load.
Upvotes: 0
Reputation: 706
function bothFunctions() {
calculateComission()
calcMonthlyPay()
}
input(type='button' value='Calcular' onClick="bothFunctions()")
Upvotes: 6