Tags are missing in this code. u can put "<" for missing placesscript language ="javascript" type="text/javascript" if(typeof(raju)=='undefined') { raju={}; } raju.Gen=function(count) { var div=document.getElementById("MyDiv"); var content=""; for(i=0;i { content+="br/>input type='text' id='txt'"+i+" />br/>"; } div.innerHTML=content; } script input type="text" id="txtCount" onchange=" raju.Gen(this.value);" / input type="button" id="btnGen" value="generate" style="width: 82px" / div id="MyDiv" /div>/body>/html>