Edit This Code:
<!DOCTYPE html>
<html>
<body>

<p>x = 10 and y = 5, calculate x %= y, and display x:</p>

<button onclick="myFunction()">Try it</button>

<p id="demo"></p>

<script>
function myFunction() {
    var x = 10;
    var y = 5;
    x %= y;
    document.getElementById("demo").innerHTML = x;
}
</script>

</body>
</html>


Result:
Try it Yourself - © w3schools.com
Privacy Policy