jeudi 19 octobre 2017

How to loop if and for together

if (di >= "16") {
        for (i=16; i >=16; i++) {
document.getElementById(i + "<br>");
}
text = 'Use Digital Input Module';
document.getElementById('EZLGX-IO-16DCI').style.display = 'block';  }

In above code, i'm trying to loop the if value >=16 to display multiple times od the elementId i.e if value is 20 the output to be 2 of (EZLGX-IO-16DCI). Help me understand how to do this!!

Aucun commentaire:

Enregistrer un commentaire