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

<p>Click the button to evaluate/execute JavaScript code/expressions.</p>

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

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

<script>
function myFunction() {
    var x = 10;
    var y = 20;
    var a = eval("x * y") + "<br>";
    var b = eval("2 + 2") + "<br>";
    var c = eval("x + 17") + "<br>";

    var res = a + b + c;
    document.getElementById("demo").innerHTML = res;
}
</script>

</body>
</html>


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