So..i\'m having this problem for couple of days not knowing how to do this,and i need help.
I have multiple buttons and clicking all of them is redirecting me to sam
IF you can change the HTML, try:
And change your JS to:
function myFunction(bnum)
{
var x=0;
if (bnum == 1){
x=1;
myFunction1(x);}
if (bnum == 2){
x=2;
myFunction2(x);}
if (bnum == 3){
x=3;
myFunction3(x);}
}
It's a bit nicer in a switch:
function myFunction(bnum)
{
var x=0;
switch (bnum) {
case 1:
x = 1;
myFunction1(x);
break;
case 2:
x = 2;
myFunction1(x);
break;
case 3:
x = 3;
myFunction1(x);
break;
}
}