Javascript examples for DOM HTML Element:Form Event
Assign value from input box to <div> element
<!doctype html> <html> <head></head> <body> <script> function myFunction()/* www.ja va 2s . co m*/ { var input = document.getElementById('fname') var div = document.getElementById('text'); div.innerHTML = escape(input.value); } </script> <input type="text" id="fname" onkeyup="myFunction()"> <div id="text"></div> </body> </html>