把以下彩色代码保存到test2.htm动态按钮程序演示:(如果你用下面的代码,请把“\/\/”修改) “<\/html><\head\> </\Script Language="JavaScript"/\> //</\FONT/\> <\/FONT lang=ZH-CN face=System,?? color=#33aecc>原来的颜色</\FONT> <\/FONT face="Courier New" color=#33aecc> document.bgColor="blue"; document.vlinkColor="white"; document.linkColor="yellow"; document.alinkcolor="red"; //<\/FONT> <\/FONT lang=ZH-CN face=System,?? color=#33aecc>动态改变颜色<\/FONT> <\/FONT color=#33aecc></\FONT face="Courier New">function changecolor() { document.bgColor="red"; document.vlinkColor="blue"; document.linkColor="green"; document.alinkcolor="blue"; } <\/script> </\HEAD> <\/body bgColor="White" > <A href="test2.htm"> <\/FONT> <\/FONT lang=ZH-CN face=System,??>调用动态按钮文档<\/FONT><\/FONT> </\FONT face="Courier New"><\/FONT color=#33aecc><\/a><\/form > <\/Input type="button" Value="red" onClick="changecolor()"\/> <\/form><\/BODY><\/HTML>”
输出结果见图所示。
 |