title: I have 10 buttons that I want when I press a button, a function occurs
body: <p>I have a page with 10 buttons I want when I press a button the speech inside it changes
  And div appears, and when you click the second time, everything returns as it was</p>
  <p>button 10 html</p>
  <pre><code>&lt;button class=&quot;button&quot; id=&quot;movetool&quot;&gt;click 1&lt;/button&gt;
  &lt;button class=&quot;button&quot; id=&quot;movetool2&quot;&gt;click 2&lt;/button&gt;
  &lt;button class=&quot;button&quot; id=&quot;movetool3&quot;&gt;click 3&lt;/button&gt;
  &lt;button class=&quot;button&quot; id=&quot;movetool4&quot;&gt;click 4&lt;/button&gt;
  &lt;button class=&quot;button&quot; id=&quot;movetool5&quot;&gt;click 5&lt;/button&gt;
  &lt;button class=&quot;button&quot; id=&quot;movetool6&quot;&gt;click 6&lt;/button&gt;
  &lt;button class=&quot;button&quot; id=&quot;movetool7&quot;&gt;click 7&lt;/button&gt;
  &lt;button class=&quot;button&quot; id=&quot;movetool8&quot;&gt;click 8&lt;/button&gt;
  &lt;button class=&quot;button&quot; id=&quot;movetool9&quot;&gt;click 9&lt;/button&gt;
  &lt;button class=&quot;button&quot; id=&quot;movetool0&quot;&gt;click 10&lt;/button&gt;
  </code></pre>
  <p>button javacsript</p>
  <pre><code>var activeButton = localStorage.getItem('activeButton');
  var isActive = localStorage.getItem('isActive');
  const allButtons = document.querySelectorAll(&quot;.button&quot;);
  
  [...allButtons].forEach(function(thisButton) {
    if (isActive === 'true') {
      if (activeButton !== thisButton.id) {
        thisButton.disabled = true;
  
      }
    }
  });
  
  const movetool = event =&gt; {
    activeButton = localStorage.getItem('activeButton');
    const target = event.target.closest(&quot;button&quot;);
    if (activeButton === target.id) {
      var enableAll = false;
      Array.from(allButtons).forEach(function(thisButton) {
        if (thisButton.disabled) {
          enableAll = true;
          return;
        }
      });
  
      if (enableAll) {
        Array.from(allButtons).forEach(function(thisButton) {
          thisButton.disabled = false;
        });
  
        localStorage.setItem('isActive', false);
  
      } else {
        Array.from(allButtons).forEach(function(thisButton) {
          thisButton.disabled = true;
        });
        if (target.classList.contains(&quot;button&quot;)) {
          target.disabled = false;
          localStorage.setItem('isActive', true);
          localStorage.setItem('activeButton', target.id);
        }
      }
    } else {
      Array.from(allButtons).forEach(function(thisButton) {
        thisButton.disabled = true;
      });
      if (target.classList.contains(&quot;button&quot;)) {
        target.disabled = false;
        localStorage.setItem('isActive', true);
        localStorage.setItem('activeButton', target.id);
      }
    }
  }
  document.querySelector('.button_container').addEventListener('click', movetool);
  </code></pre>
  <p>I want to change the text when I press the button to &quot;clicked&quot;
  and show div</p>
  <p>code</p>
  the button is clicked