[JS9] document's bgColor改变背景颜色

 

 1 <HTML>
 2     <HEAD>
 3         <TITLE>设置背景颜色</TITLE>
 4     </HEAD>
 5 <BODY>
 6     <CENTER>
 7         <FORM>
 8             <BR>
 9             <H1>
10             利用 document's bgColor 属性
11             <BR>
12             <BR>
13             来改变页面的背景色......
14             </H1>
15             <BR>
16             <BR>
17             <BR>
18             <INPUT TYPE = BUTTON Value = "随机改变背景颜色" onClick = "colorBackground()">
19         </FORM>
20     </CENTER>
21 </BODY>
22 <SCRIPT LANGUAGE = JavaScript>
23     function colorBackground()
24     {
25         document.bgColor +=0X000008
26     }
27 </SCRIPT>
28 </HTML>

 

posted @ 2014-05-13 23:48  beautifulzzzz  阅读(2386)  评论(0编辑  收藏  举报