W3School TIY Editor
W3School 在线教程
改变方向
暗黑模式
运行代码
<!DOCTYPE html> <html> <body> <p>单击按钮以评估/执行 JavaScript 代码/表达式。</p> <button onclick="myFunction()">试一试</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>