<html>
<body>
<p>Assign 5 to x and 6 to y, and display the result of x + y:</p>
<button onclick="myFunction()">Try it</button>
<p id="demo"></p>
<script>
function myFunction() {
var x = 5;
var y = 6;
document.getElementById("demo").innerHTML = x + y;
}
</script>
</body>
<!-- Mirrored from www.w3schools.com/jsref/tryit.asp?filename=tryjsref_state_var2 by HTTrack Website Copier/3.x [XR&CO'2014], Mon, 27 Jan 2020 03:01:34 GMT -->
</html>