Discussion Locked

JavaScript / DHTM -> innerHTML

0 helpful
4 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

Can the ID name with the innerHTML (.innerHTML) be changed with the help of for statement in JavaScript:
Code Below (not working)

*************************************************
function Common_Required_Field()
{
var Var_Required_Fields_Common = new Array("Fldtxt1", "Fldtxt2", "Fldtxt3", "Fldtxt4");
for (i=0; i *";
}
}

Type of User

Type of User

Type of User

Type of User

*************************************************

4 replies

by rakeshkanojia

Thanks for replying Jay but your solution did not work

But the below code worked after a long try :-)

************************************************************
GetCommonFldID = Var_Required_Fields_Common[i];
GetElementToChange=document.getElementById(GetCommonFldID);
GetElementToChange.innerHTML = NewText;
************************************************************

This discussion is closed to new replies.