dynamic control with getElementById
I need to give a variable control with getElementById.
something like document.getElementById("Control" + i).innerHTML
it gives error.
how can i do this?
How are you using this statement?
I have few controls created dynamically on form. I need to set their inner html with AJAX. so it should look like
document.getElementById(elem).innerHTML = strValue;
where elem will be the name of control taken as a variable.
just need to know the current syntax how it will work.
You are sill not showing how you are using this statement.
You possibly require a closure to pass the variable: http://www.webdeveloper.com/forum/sh...8&postcount=11
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)