I tried the following: it is working fine
function saveTitle(index,id){
arrtitle[1] = document.getElementById("title_1").value;
arrtitle[2] = document.getElementById("title_2").value;
arrtitle[3] = document.getElementById("title_3").value;
}
but as I tried the following:
function saveTitle(index,id){
for(i=1;i<=count;i++)
arrtitle[i] = document.getElementById("title_"+i).value;
}
It gives me an error that : Uncaught TypeError: Cannot read property 'value' of null
Please suggest me something. Thanks...
You can use querySelectorAll to get all the elements that contains "title_" string . See the bellow code.