I create text box dynamically and assign its ID dynamically. in javascript if I call getElementById the alert fails, just nothing happens.
<% for(int i=0; i<lines.length;i++) {
if(lines[i].contains(" ")) { %>
<input type=text name='key1<%=i%>' id="idkey<%=i%>" value ="<%=abc%>"/>
<%
}
} %>
Javascript :
for(j=0; j<len; j++){
var lblElement = getElementById("idkey"+j);
alert(lblElement);
}