Note that there are some explanatory texts on larger screens.

plurals
  1. POWhat am i doing wrong in the following code?
    text
    copied!<pre><code>&lt;html&gt; &lt;h1&gt;MB calculator&lt;/h1&gt; &lt;script type="text/javascript"&gt; var level = "0"; var brawlpoints = "0"; var brawlenergy = "0"; var pointsmake = "0"; function setlv() { level = docuent.forms["form"]["lv"].value; alert("level = " + level); } var maxen = 95+(lv*5); var exptolv = 110+(lv*15); function setbpbe() { brawlpoints = document.forms["form"]["bp"].value; brawlenergy = document.forms["form"]["be"].value; alert("points per brawl = " + brawlpoints + "; energy per brawl = " brawlenergy); } function pointsupdate() { pointsmake = document.forms["form"]["p2m"].value; alert("you want to make " + pointsmake); } function calculate() { var math1 = pointsmake/brawlpoints + 1; var math2 = brawlenergy*math1; var math3 = maxen*1.75; var math4 = math2/math3 + 1; document.write("To achieve your goal it will take you " + math1 + " brawls, this will take you " + math2 + " energy, or " + math4 + " levels, assuming a 75% refill levels you.); } &lt;/script&gt; &lt;form name="form"&gt; level: &lt;input type="text" name="lv" value="0"&gt; &lt;br&gt; &lt;input type="button" value="update level" onclick="setlv()"&gt; &lt;br&gt; points per brawl done: &lt;input type="text" name="bp" value="0"&gt; &lt;br&gt; energy per brawl done: &lt;input type="text name="be" value="0"&gt; &lt;br&gt; &lt;input type="button" value="update brawl energy and points" onclick="setbpbe()"&gt; &lt;br&gt; how many points you want to make: &lt;input type="text" name="p2m" value="0"&gt; &lt;br&gt; &lt;input type="button" value="set points you want to make" onclick="pointsupdate()"&gt; &lt;/form&gt; &lt;input type="button" value="calculate" onclick="calculate()"&gt; &lt;h1&gt;LV calculator&lt;/h1&gt; &lt;/html&gt; </code></pre> <p>I looked through it a few times and i can't tell what i am doing wrong... Sorry for posting the whole thing but i couldn't even really narrow down where the error is, i checked it up against a similar code i have that works fine, i couldn't find a difference other then names which i was consistent with... the buttons are what aren't working. Thanks for any help.</p> <p>Javascript Output Console</p> <pre><code>Uncaught ReferenceError: calculate is not defined test.html:64 Uncaught ReferenceError: pointsupdate is not defined test.html:61 Uncaught ReferenceError: setbpbe is not defined test.html:56 Uncaught ReferenceError: setlv is not defined test.html </code></pre> <p>javascript output console while clicking each button</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload