Codepedia
.info
Home
About
Demos
Tools
SVG Wave Generator
Colors
Edit This Code :
<html> <body> <form> <input type=hidden id="myHiddenInputId" name="myHiddenInputName" value="Welcome to codepedia" /> <input type=button value="Get Hidden Value by Id" onclick="fnById()" /> <input type=button value="Get Hidden Value by Name" onclick="fnByName()" /> </form> <script> function fnById() { alert(document.getElementById("myHiddenInputId").value); } function fnByName() { alert(document.getElementsByName("myHiddenInputName")[0].value); } </script> </body> </html>
➤ Run / View
Result :