Javascript examples for DOM HTML Element:Input Hidden
The Input Hidden object represents an HTML <input> element with type="hidden".
You can access an <input> element with type="hidden" by using getElementById():
<!DOCTYPE html> <html> <body> <input type="hidden" id="myInput" value="java2s.com"> <button onclick="myFunction()">get the value of the hidden input field</button> <p id="demo"></p> <script> function myFunction() {/*ww w.j a v a 2s . c om*/ var x = document.getElementById("myInput").value; document.getElementById("demo").innerHTML = x; } </script> </body> </html>