J.Rodriguez
0
Q:

javascript input field

<!DOCTYPE html> 
<html> 
  <body>
    <input> Here is your inputfield </input>
  </body>
</html>
1
<input type="radio">Hi</input>
3
<!DOCTYPE html> 
<html> 
  
<head> 
    <title> 
        HTML DOM Input Text Object 
    </title> 
</head>    
  
<body>  
  
    <h1>GeeksForGeeks</h1>  
  
    <h2>DOM Input Text Object</h2> 
  
    <input type="text" id="text_id" value="Hello Geeks!"> 
      
    <p>Click on button to display the text field</p> 
      
    <button onclick="myGeeks()">Click Here!</button> 
      
    <p id="GFG"></p> 
      
    <!-- script to access text field -->
    <script> 
        function myGeeks() { 
            var txt = document.getElementById("text_id").value; 
            document.getElementById("GFG").innerHTML = txt; 
        } 
    </script> 
</body> 
  
</html>                     
1

New to Communities?

Join the community