源代码
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>享学课堂</title> </head> <body> <p>一个典型的算术运算需要两个数字(或变量),并产生一个新的数.</p> <p id="demo"></p> <script> var a = 100; var b = 50; var x = a + b; document.getElementById("demo").innerHTML = x; </script> </body> </html>
运行结果