Get your own website Result Size: 625 x 565
x
 
<!DOCTYPE html>
<html>
<body>
<form id="frm1" action="https://www.w3schools.com/action_page.php">
<button id="btn1" name="subject" type="submit" value="fav_HTML">HTML</button>
<button id="btn2" name="subject" type="submit" value="fav_CSS">CSS</button>
</form>
<p>Click the "Try it" button to return the text on the "HTML" button:</p>
<button onclick="myFunction()">Try it</button>
<p id="demo"></p>
<script>
function myFunction() {
  var x = document.getElementById("btn1").innerHTML;
  document.getElementById("demo").innerHTML = x;
}
</script>
</body>
<!-- Mirrored from www.w3schools.com/js/tryit.asp?filename=tryjs_button_text by HTTrack Website Copier/3.x [XR&CO'2014], Mon, 05 Sep 2022 14:47:02 GMT -->
</html>