陪你做好前端设计!
源代码:
点击运行
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>素材8网教程(study.sucai8.cn)</title> </head> <body> <h1>我的网页</h1> <p id="demo1"></p> <p id="demo2"></p> <script> a = 1; b = 2; c = a + b; document.getElementById("demo1").innerHTML = c; x = 1; y = 2; z = x + y; document.getElementById("demo2").innerHTML = z; </script> </body> </html>
运行结果