Html page:
<button onclick="myFunction()">Try it</button>
<p id="P6"></p>
Javascript page:
<script>
function myFunction() {
var y = 5;
var x = y - 2;
document.getElementById("demo").innerHTML
= x;
}
</script>
Output:
3
No comments:
Post a Comment