[]为什么脚本运行后,背景色没有变呢

[求助]为什么脚本运行后,背景色没有变呢?JScript codehtmlheadscriptfunction welcome(){document.b

[求助]为什么脚本运行后,背景色没有变呢?

JScript code
<html><head><script>function welcome(){    document.bgColor = "pink";    document.write("天生我材必有用");}</script></head><body><a href="javascript:welcome();">不知道</a></body></html>


[解决办法]
HTML code
<html><head><script>function welcome(){       document.write("天生我材必有用"); document.bgColor = "pink";}</script></head><body><a href="javascript:welcome();">不知道</a></body></html>