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