Read textbox values and display on a blank page - Javascript DOM HTML Element

Javascript examples for DOM HTML Element:Input Text

Description

Read textbox values and display on a blank page

Demo Code

ResultView the demo in separate window

<html>
   <head> 
      <title>Untitled 1</title> 
      <script type="text/javascript">

function getdata()/* w  ww .  j  a va  2s  .c  o m*/
{
    var val=document.getElementById('t1').value;
    var win=open("");
    win.document.write(val);
    
}
      </script> 
   </head> 
   <body> 
      <input id="t1" type="text"> 
      <input id="B1" type="button" value="getdata" onclick="getdata()">  
   </body>
</html>

Related Tutorials