I have a Javascript function as below:
function letMeGo(var1, var2, var3){
if(var1 == 1 && var2 == 1 && var3 == 1){
document.getElementById('goOn').href="goOn.php";
}
}
the variables are the return of other functions.
And I need it to be triggered by:
<a id="goOn" onclick="letMeGo(var1, var2, var3)">Go On</a>
it is not working unless I removed the variable in both, the link and the function. How can i get it to work with them?
letMeGo?<a id="goOn" onclick="letMeGo(1, 1, 1)">Go On</a>. If so, then you need to check the values of those three variables before binding thatonClickhandler. That code seems to be absent from your question.