Codepedia
.info
Home
About
Demos
Tools
SVG Wave Generator
Colors
Edit This Code :
<html> <head> </head> <body> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script><br/> <input id="myInputHidden" name="myInputName" type="hidden" value="Codepedia" /> <button id="btnShow1"> Get Hidden field Value by ID</button> <button id="btnShow2"> Get Hidden field Value by Name</button> <button id="btnShow3"> Get Hidden field Value by Type</button> <br/> <script> $(document).ready(function(){ $("#btnShow1").on('click', function () { var getValue= $("#myInputHidden").val(); alert(getValue); }); $("#btnShow2").on('click', function () { var getValue= $("input[name=myInputName]").val(); alert(getValue); }); $("#btnShow3").on('click', function () { var getValue= $("input[type=hidden]").val(); alert(getValue); }); }); </script> </body> </html>
➤ Run / View
Result :