A. McCurran
0
Q:

css change the button text value

  function show() {
    // get the box
    var box = document.getElementById('box');

    // get the current value of the box's display property
    var displaySetting = myClock.style.display;

    // also get the box button, so we can change what it says
    var showButton = document.getElementById('showButton');

    // now toggle the box and the button text, depending on current state
    if (displaySetting == 'block') {
      // box is visible. hide it
      myClock.style.display = 'none';
      // change button text
      clockButton.innerHTML = 'Show box';
    }
    else {
      // box is hidden. show it
      myClock.style.display = 'block';
      // change button text
      clockButton.innerHTML = 'Hide box';
    }
  }
1
document.getElementById("myButton").innerHTML="new button text";
1
#search {
    width: 20em;  height: 2em;
}
0

New to Communities?

Join the community