Hello Guys,
I’d like some help in changing these few lines of code into a for loop
export function button1_click(event, $w) {
if($w(“#input1”).value === “1”) {
$w(‘#button1’).disable();
wixLocation.to(“https://www.google.com”);
}
else {
$w(‘#group1’).hide();
$w(‘#group2’).show();
}
}
export function button2_click(event, $w) {
if($w(“#input2”).value === “2”) {
$w(‘#button2’).disable();
wixLocation.to(“https://www.google.com”);
}
else {
$w(‘#group2’).hide();
$w(‘#group3’).show();
}
}
export function button3_click(event, $w) {
if($w(“#input3”).value === “1”) {
$w(‘#button3’).disable();
wixLocation.to(“https://www.google.com”);
}
else {
$w(‘#group3’).hide();
$w(‘#group4’).show();
}
}
Thanks in advance.