A function that is not a function?
<p>I'm still new to coding and I'm trying to make a cookie clicker type game. I get</p>

<blockquote>
  <p>upgradecursor is not a function</p>
</blockquote>

<p>when I run it on Chrome. I don't really understand the problem as I have a function called <code>upgradecursor</code>.
Pls help! :(</p>

<p><div class="snippet" data-lang="js" data-hide="false">
<div class="snippet-code">
<pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;!DOCTYPE html&gt;
&lt;html&gt;
&lt;head&gt;
 &lt;title&gt; Test &lt;/title&gt;
 &lt;script&gt;
 //List of variables
 var cookie = 0;
 var cursor = 1;
 var cursorupgradecost = 10;

function addcookie(){
    var textField = document.getElementById( "textField" );
    var currentValue = parseInt(textField.value);
 cookie = cookie + cursor;
 // Add one
    currentValue = currentValue + cursor;

    // Put it back with the new +1'd value
    textField.value = currentValue;}

function upgradecursor(){
 var textField = document.getElementById( "textField" );
    var currentValue = parseInt(textField.value);
 cookie = cookie - cursorupgradecost; 
 // Minus one
    currentValue = currentValue - cursorupgradecost;

    // Put it back with the new -10'd value
    textField.value = currentValue;
 
 //change the cost of the upgrade
 cursorupgradecost = cursorupgradecost * 1.5;
 
 //Upgrade the cursor
 cursor = cursor + 1;
}

&lt;/script&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;script&gt;
if (cursorupgradecost &gt; cookie){
upgradecursor = false;}
else{
upgradecursor = true;}
&lt;/script&gt;

&lt;button type ="button" onClick = "upgradecursor()"/&gt;Upgrade Cursor &lt;/button&gt;
&lt;input type="text" value="0" disabled name="lvl"&gt;
 &lt;br&gt;
 &lt;button type="button" onClick="addcookie()"/&gt;Add Cookie&lt;/button&gt;
 &lt;input type="button" value="Cookies" disabled name="clicker"&gt; 

&lt;input type="text" value="0" id="textField" readonly/&gt;

&lt;/body&gt;
&lt;/html&gt;</code></pre>
</div>
</div>
</p>