I have this part of code:
for (i = 0; i <= texte.split(';')[1].split(',').length - 1; i++) {
cell = document.createElement("td");
cell.setAttribute("width", "10%");
cell.setAttribute("align", "center");
if (texte.split(';')[1].split(",")[i] != "")
cell.onclick = function () { chgnom('1',"'" + texte.split(';')[1].split(",")[i] + "'",''); };
textnode = document.createElement("span");
textnode.innerHTML = texte.split(';')[1].split(",")[i];
cell.appendChild(textnode);
row.appendChild(cell);
}
The call to texte.split(';')[1].split(",")[i] in innerHTML returns 'HELLO', but the one in function return 'undefined'. Could someone help me with this?
Thank you