samedi 7 octobre 2017

Cannot read property 'textContent' of undefined Error

this is my code and I do not understand why give this error, i create my arrays but when i try to read textContent i had an error

    var valori =  document.getElementsByClassName('value');
    var nomi =  document.getElementsByClassName('name');

    for(i=0; i<nomi.length; i++) {

    for(k=0; k<itemsTitleiT.length; i = i+1) {


        if(nomi[i].textContent == "GENERALI"){

                flag = 1;
                nomi[i].className += " Principal";
                break;

            }

}

Aucun commentaire:

Enregistrer un commentaire