title: Make a progress bar that activate on click for a certain amount of time
body: <p>I realize there is a similar questions <a href="https://stackoverflow.com/questions/15019381/using-jquery-javascript-to-turn-a-button-into-a-progress-bar">here</a>, but the code is not working when I try to adapt it to my case. So here are some details:</p>
  
  <p>In an idle game I'm making, the user can make multiple action but I would like him to know if the action is in progress or not. So when he would click my div, its background could fill up like a progress bar. </p>
  
  <p>my html: </p>
  
  <pre><code>&lt;div class="button" onClick="makeMoney()" id="makeMoney"&gt;
  &lt;span&gt;Go To Work&lt;/span&gt;&lt;/div&gt;
  </code></pre>
  
  <p>my JS: </p>
  
  <pre><code>function makeMoney() {
  var btn = document.getElementById("makeMoney");
  if (btn.getAttribute('disabled') == 'disabled') {
     return;
  }
  btn.setAttribute('disabled', 'disabled')
  setTimeout(function () {
      money += job;
      document.getElementById("money").innerHTML = money;
      btn.removeAttribute('disabled')
  }, 10000)
  };
  </code></pre>