Code <SCRIPT>
Function $ (OBJ)
{
Return document. getelementbyid (OBJ );
}
Function pickcolor ()
{
If (! Window. isie) return;
VaR scolor = $ ('dlghelper '). choosecolordlg ();
VaR color = scolor. tostring (16 );
While (color. length <6) color = "0" + color;
Window. Color = color;
Color = "#" + color;
$ ('Div _ color'). style. backgroundcolor = color;
$ ('Div _ color'). value = color;
}
VaR isie = (document. All & window. activexobject )? True: false;
</SCRIPT>
<Object ID = "dlghelper" classid = "CLSID: 3050f819-98b5-11cf-bb82-00aa00bdce0b" width = "0px" Height = "0px"> </Object>
<Input class = "inputtext" style = 'width: 50px; cursor: hand; 10px; Background-color: #000000; color: # ffffff; 'id = 'div _ color' value = "#000000"/>
<Input type = "button" value = 'retrieve color'>
Specific effect, you can test by yourself, or move to Anhui PHP community http://bbs.hfphp.org
Or jincon's package blog http://www.yi1.com.cn
Source: http://bbs.hfphp.org/thread-1372-1-1.html