Edit This Code:
See Result »
<!DOCTYPE html> <html> <body> <p>Assign 5 to x and 6 to y, and display the result of x + y:</p> <button onclick="myFunction()">Try it</button> <p id="demo"></p> <script> function myFunction() { var x = 5; var y = 6; document.getElementById("demo").innerHTML = x + y; } </script> </body> </html>
Result: