x
 
<!DOCTYPE html>
<html>
<body>
<p>单击该按钮可显示隐藏输入字段的 value 属性的值。</p>
<input type="hidden" id="myInput" value="W3School">
<button onclick="myFunction()">试一试</button>
<p id="demo"></p>
<script>
function myFunction() {
  var x = document.getElementById("myInput").value;
  document.getElementById("demo").innerHTML = x;
}
</script>
</body>
</html>