Run ❯
Get your
own
website
Result Size:
625 x 565
×
Change Orientation
Save Code
Change Theme, Dark/Light
Go to Spaces
<!DOCTYPE html> <html> <body> <h1>JavaScript Variables</h1> <p>In this example, price1, price2, and total are variables.</p> <p id="demo"></p> <script> const price1 = 5; const price2 = 6; let total = price1 + price2; document.getElementById("demo").innerHTML = "The total is: " + total; </script> </body> </html>