<!DOCTYPE html><html lang="en"><head><meta charset="UTF-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><title>改变网页背景色</title><script>function color(str){document.body.style.backgroundColor = str;}</script></head><body><input type="button" value="红色" onclick="color('red')"><input type="button" value="黄色" onclick="color('yellow')"><input type="button" value="蓝色" onclick="color('blue')"><input type="button" value="自定义色" onclick="color('#00ff00')"></body></html>
1200字范文,内容丰富有趣,写作的好帮手!