JavaScript Variables

Sunny.Sagar
Posted by Sunny.Sagar under JavaScript category on | Points: 40 | Views : 242
<body>

<h1>JavaScript Variables</h1>

<p id="Example"></p>

<script>
var price1 = 15;
var price2 = 61;
var total = price1 + price2;
document.getElementById("Example").innerHTML =
"The total is: " + total;
</script>

Comments or Responses

Login to post response