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>
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;

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

  • 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\$ Nov 21, 2017 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\$ Nov 21, 2017 at 21:28

1 Answer 1


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;

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