Get your own website Result Size: 625 x 565
x
 
<!DOCTYPE html>
<html>
<body>
<p>Click the input button to display the value of its value attribute.</p>
<input type="button" onclick="myFunction()" id="myBtn" value="Try it">
<p id="demo"></p>
<script>
function myFunction() {
  var x = document.getElementById("myBtn").value;
  document.getElementById("demo").innerHTML = x;
}
</script>
</body>
<!-- Mirrored from www.w3schools.com/jsref/tryit.asp?filename=tryjsref_inputbutton_value by HTTrack Website Copier/3.x [XR&CO'2014], Mon, 05 Sep 2022 15:53:05 GMT -->
</html>