<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>菜鸟教程(runoob.com)</title> </head> <body> <p>点击下面的按钮来显示Who is my lover:</p> <button οnclick="myFunction()">点击这里</button> <p id="demo"></p> <script> function myFunction(){ var x="TOM"; switch (x){ case 0:x="不喜欢"; break; case "TOM":x="TOM is my love"; break; } document.getElementById("demo").innerHTML=x; } </script> </body> </html>
JS写TOM
最新推荐文章于 2024-08-26 20:25:07 发布