-2
\$\begingroup\$

Here's a (probably) simple question for you all, I need some simple equations generated via javascript to display on my website, but I am unable to do so. Following online tutorials, I have:

<h2>The += Operator</h2>
<p id="demo"></p>
<script>
var w = 5;
var x = 5;
var y = 5;
var z = 5;
w += 5;
x += 6;
y += 7;
z += 8;
document.getElementById("demo").innerHTML = wxyz;
</script>

Any suggestions? Thank you and have a good day :)

\$\endgroup\$

closed as off-topic by Jamal Nov 21 '17 at 1:54

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Questions containing broken code or asking for advice about code not yet written are off-topic, as the code is not ready for review. After the question has been edited to contain working code, we will consider reopening it." – Jamal
If this question can be reworded to fit the rules in the help center, please edit the question.

  • 1
    \$\begingroup\$ Code Review is for open-ended questions about code that already works correctly (to the best of your knowledge). Questions seeking help about debugging or understanding code are off-topic for Code Review, and may be on-topic for Stack Overflow. See What types of questions should I avoid asking? \$\endgroup\$ – Sᴀᴍ Onᴇᴌᴀ Nov 21 '17 at 0:17
  • \$\begingroup\$ im not sure what js equations are, i assume you mean either math expressions or js code, if the latter you should have a look at codemirror or ace text editor which is great for showing code with js \$\endgroup\$ – I wrestled a bear once. Nov 21 '17 at 21:28
1
\$\begingroup\$

You should probably post this on stackoverflow, since this is for code reviewing.

You have an error here

document.getElementById("demo").innerHTML = wxyz;

Do this to see what happens

document.getElementById("demo").innerHTML = w + " " + x + " " + y + " " + z;
\$\endgroup\$

Not the answer you're looking for? Browse other questions tagged or ask your own question.