源代码 :
点击运行
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> </head> <body> <script> function ChangeBackground() { document.body.style.backgroundColor="lavender"; } </script> <input type="button" onclick="ChangeBackground()" value="修改背景颜色" /> </body> </html>
运行结果