solar Posted March 2, 2010 Share Posted March 2, 2010 <html><body><form><input id="inp" type="text" /><input type="button" value="button" onclick="funct()" /></form><div id="dv">abc</div><script type="text/javascript">function funct() {var x = document.getElementById('inp').value;var t = x.length;for (i=0;i<t;i++) {z = document.getElementById('dv').innerHTTML;document.getElementById('dv').innerHTTML = z.concat(x.charAt(i));}}</script></body></html> i want to concatenate input text to <div>'s content one character at a time.so if i type defgh in the text field, after pressing the button <div> should show abcdefgh, right?but it's not working Link to comment Share on other sites More sharing options...
justsomeguy Posted March 2, 2010 Share Posted March 2, 2010 document.getElementById('dv').innerHTTML Link to comment Share on other sites More sharing options...
solar Posted March 3, 2010 Author Share Posted March 3, 2010 damit!am i stupid beginner :)delete this thread, please Link to comment Share on other sites More sharing options...
ShadowMage Posted March 3, 2010 Share Posted March 3, 2010 Happens to all of us... Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.