一、代码如下
二、执行效果如下
<!DOCTYPE html> <html> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <body> <h1>我的第一张网页</h1> <p id="demo1"></p> <script> var a, b, c; a = 5; b = 6; c = a + b; document.getElementById("demo1").innerHTML = c; </script> </body> </html>