title: Making an HTML game-ish thing
body: <p>So I'm using Notepad++ with HTML and javascript to try and make a little clicker game (Similar to cookie clicker if you've ever played it) and I'm just using it to experiment with stuff. I have a uneditable text field and a button that when clicked adds "1" to the value of the textfield. I've been trying to create another button that simply checks for a value greater or equal to five in the text field, then subtract five if it's true. (The ultimate goal is to have three buttons -- One that when clicked checks for a value greater than five, then subtracts five, which makes another button that wasn't clickable become clickable, which will add 10 to the value when clicked kind of like an upgrade.)</p>
  
  <p>I've got the button to add +1 to the value, and I've been trying to get the upgrade one to enable a disabled button. But for some reason the button won't work..</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
  &lt;head&gt;
      &lt;title&gt;Button Clicker&lt;/title&gt;
      &lt;script language="Javascript"&gt;
  function handleButtonClick() {
      var textField = document.getElementById( "textField" );
      var currentValue = parseInt(textField.value);
  
      // Add one
      currentValue = currentValue + 1;
  
      // Put it back with the new +1'd value
      textField.value = currentValue;
  }
  function handlebuttonclick() {
      var textField = document.getElementById( "textField" );
      var currentValue = parseInt(textField.value);
  
      // Minus one
      currentValue = currentValue - 1;
  
      // Put it back with the new -1'd value
      textField.value = currentValue;
  }
  
  &lt;/script&gt;
  &lt;/head&gt;
  &lt;body&gt;
  
  
  
  &lt;script language="Javascript" type="text/javascript"&gt;  
   function enable(){  
    if (document.form="upgrade".clicked==''){  
     document.agreement_form.clicker.disabled=true  
    }else{  
     document.agreement_form.clicker.disabled=false  
    }  
   }  
  &lt;/script&gt;
  
   &lt;button type="button" form="upgrade" onclick="enable()" onclick="handlebuttonclick"/&gt;Upgrade&lt;/button&gt;
   &lt;br&gt;
   &lt;button type="button" onClick="handleButtonClick()"/&gt;Press here&lt;/button&gt;
   &lt;input type="button" value="Clicker" disabled name="clicker"&gt; 
  
  &lt;input type="text" value="0" id="textField" readonly/&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>