Prev Demo
JavaScript
>
Evaluate
Next Demo
Write code here
J
|
B
|
A
<!DOCTYPE html> <html> <head> <title>Demo</title> </head> <body> <p>Click the below button to Evaluate.</p> <input type="button" onclick="mySearch()" value="Evaluate"> <p id="myId"></p> <script> function mySearch() { var A = 5; var B = 10; var P = eval("A * B") + "</br>"; var Q = eval("A + B") + "</br>"; var R = eval("B / A") + "</br>"; var S = P + Q + R; document.getElementById("myId").innerHTML = S; } </script> </body> </html>
Note: We DO NOT save your trial code in our database.
Output