源代码
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>享学课堂</title> </head> <body> <p>乘法优先于加法.</p> <p>但括号优先于乘法.</p> <p id="demo"></p> <script> document.getElementById("demo").innerHTML = (100 + 50) * 3; </script> </body> </html>
运行结果