how to change text when button is clicked code example
Example 1: how to change the text in a button on onclick
var btn = document.getElementById("mybtn");
btn.value = 'my value'; // will just add a hidden value
btn.innerHTML = 'my text';
Example 2: change button text by id click java
<input type="button" value="Button Text" id="myButton1"></input>