HTML and JS so buttons my button keep going away when i click it on them

43 Views Asked by At

I made a button which, when clicked, shows another button called radiusButton. When I click the radiusButton it seems to go away.

Also, how would I add another button so when I click <button id="Slow"> 2 other buttons will pop up and make it where they both stay on screen even after clicking, and when I click another button like <button id="Clear"> or <button id="Active"> it will go away?

I tried looking it up, but still didn't find anything. I'm new to all of this, just needing a little bit of help.

function toggleRadiusButton() {
  var slowButton = document.getElementById('Slow');
  var radiusButton = document.getElementById('RadiusButton');

  radiusButton.style.display = 'block';
  slowButton.disabled = true;
}
<div id="container">
  <h1 class="top-text">Traffic Control System</h1>
  <form id="form">
    <div id="container1">
      <img src="images/MTF.png" alt="mtff" class="MTF" />
      <form id="form1">
        <div></div>
        <br>
      </form>
      <hr class="Line">

      <button id="Stop" type="submit">Stop Traffic</button>
      <button id="Slow" type="button" onclick="toggleRadiusButton()">Slow Traffic</button>
      <button id="RadiusButton" style="display: none;">Radius</button>
      <button id="Clear" type="submit">Clear Traffic</button>
      <button id="Active" type="submit">Active Traffic</button>
      <button id="close">EXIT</button>
    </div>
  </form>
</div>
0

There are 0 best solutions below