<html>
<head>
<script type="text/javascript">
function alertValue()
{
alert(document.getElementById("hidden1").value)
}
</script>
</head>
<body>
<form>
<input type="hidden" id="hidden1" value="W3School" />
<input type="button" id="button1" onclick="alertValue()" value="Show value of the hidden field" />
</form>
</body>
</html>