1. Button Style
<Script>
Org_Color = document. bgColor. substring (1.10)
</Script>
<Form>
<Input type = "button" value = "pale yellow background" onClick = "document. bgColor = '# feffc6'">
<Input type = "button" value = "light blue background" onClick = "document. bgColor = '# c6fffe'">
<Input type = "button" value = "Pink background" onClick = "document. bgColor = '# ffc9c6'">
<Input type = "button" value = "" onClick = "document. bgColor = '# 508b7d'">
<Input type = "button" value = "" onClick = "document. bgColor = '# 7BC7FF'">
<Input type = "button" value = "" onClick = "document. bgColor = '# f0f0f0'">
</Form>
2. drop-down Style
<SelectonChange = "document. bgColor = this. options [this. selectedIndex]. value">
<Option value = "# C0C0C0"> gray
<Option value = "BLACK"> BLACK color
<Option value = "d2c6ff"> light blue
<Option value = "feefc7"> sun yellow
<Option value = "ffd2c6"> pale orange
<Option value = "c7fed8"> apple green
<Option value = "80ff80"> grassland green
<Option value = "# C1BC59"> Olive
<Option value = "# 7BC7FF"> sky blue
<Option value = "# AEDFD3"> blue-green
<Option value = "# 508B7D"> dark green
<Option value = "# F0F0F0"> White Rice
</Select>
3. Touch the style
<Scriptlanguage = "Javascript">
<! --
Function backcolor (form ){
Temp = ""
For (var I = 0; I <16; I ++ ){
Temp = form. color [I]. value
If (form. color [I]. checked) {document. bgColor = temp}
}
}
Function randombackground (){
Document. bgColor = getColor ()
}
Function getColor (){
Currentdate = new Date ()
Backgroundcolor = currentdate. getSeconds ()
If (backgroundcolor> 44)
Backgroundcolor = backgroundcolor-45
Else if (backgroundcolor> 29)
Backgroundcolor = backgroundcolor-30
Else if (backgroundcolor> 15)
Backgroundcolor = backgroundcolor-16
If (backgroundcolor = 0)
Return "olive ";
Else if (backgroundcolor = 1)
Return "teal ";
Else if (backgroundcolor = 2)
Return "red ";
Else if (backgroundcolor = 3)
Return "blue ";
Else if (backgroundcolor = 4)
Return "maroon ";
Else if (backgroundcolor = 5)
Return "navy ";
Else if (backgroundcolor = 6)
Return "lime ";
Else if (backgroundcolor = 7)
Return "fuschia ";
Else if (backgroundcolor = 8)
Return "green ";
Else if (backgroundcolor = 9)
Return "purple ";
Else if (backgroundcolor = 10)
Return "gray ";
Else if (backgroundcolor = 11)
Return "yellow ";
Else if (backgroundcolor = 12)
Return "aqua ";
Else if (backgroundcolor = 13)
Return "black ";
Else if (backgroundcolor = 14)
Return "white ";
Else if (backgroundcolor = 15)
Return "silver ";
}
// -->
</Script>
<Body onload = "document. bgColor = 'lime '; returntrue;">
<A href = "javascript: void (0);" onmouseover = "randombackground () "> <fontsize =" 5 "face =" "> touch me to change the background color </font> </a>
</Body>
Bytes ------------------------------------------------------------------------------------------
Click to change the background image:
<Div style = "float: right; margin-right: 20px;">
<Ahref = "javascript: void (0);"> </a>
<Ahref = "javascript: void (0);"> </a>
<Ahref = "javascript: void (0);"> </a>
<Ahref = "javascript: void (0);"> </a>
<Ahref = "javascript: void (0);"> </a>
<Ahref = "javascript: void (0);"> </a>
</Div>
Solutions unavailable for IE6:
Author: dudu01