Answers for "how to change text when a button is clicked code"

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';
Posted by: Guest on October-21-2020

Code answers related to "how to change text when a button is clicked code"

Browse Popular Code Answers by Language