Multiple If Functions not running

Hey guys,

I want to run multiple IF functions but the code I’m using does not work. Can anyone help ?

export function dynamicDataset_ready() {
   metrep();
}

async function metrep() {
 
 if ($w("#metrep").text === "Yes") { //first text element 
        $w("#metrepyes").show();
    }
 else if ($w("#metrep").text === "No") {
        $w("#metrepno").show();
    }

 if($w("#tele").text === "Yes") { //second text element
        $w("#repteleyes").show();
    }
 else if ($w("#tele".text) === "No") {
        $w("#repteleno").show();
    }
 
 if($w("#ex").text === "Yes") { //third text element
        $w("#exyes").show();
    }
 else if ($w("#ex").text === "No") {
        $w("#exno").show();
    }
 
 if($w("#exbuy").text === "Yes") { //fourth text element
        $w("#exbuyyes").show();
    }
 else if ($w("#exbuy").text === "No") {
        $w("#exbuyno").show();
    }

 if($w("#dep").text === "Yes") { //fifth text element
        $w("#depyes").show();
    }
 else if ($w("#dep").text === "No") {
        $w("#depno").show();
    }
}

Thank you

Hi Shan.
You have error in your code, if you have 2 conditions, you need to use if/else, not if/else if.
I recommend you to read this article. JavaScript if else else if