if click on button name should be changed in javascript code example
Example: 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';