The simplest, add in the body area: Copy the code The code is as follows: JS called: Copy code The code is as follows: <br>var tempColor = "0099cc"; <br>function picColor(){ <br>var Hcolor = document.getElementById("dlgHelper").ChooseColorDlg(tempColor).toString(16); <br>//with( event.srcElement){ <br>//value = ((Hcolor.length<6)?"000000".substring(0,6-Hcolor.length):"") Hcolor; <BR>//style.backgroundColor = ((Hcolor.length<6)?"000000".substring(0,6-Hcolor.length):"") Hcolor; <BR>var newColor = ((Hcolor.length<6)?"000000".substring( 0,6-Hcolor.length):"") Hcolor; <BR>if(newColor.toString().substring(0,1) != "#"){ <BR>newColor = "#" newColor; <BR>} <BR>alert(newColor); <BR>} <BR>// tempColor = Hcolor; <BR>// window.alert(tempColor); <BR>//} <br><br></ script><br> </div> <br>or use this directly: <br><div class="htmlarea"> <textarea id="runcode8077"> <meta http-equiv="Content-Type" content="text/html; charset=gb2312"> <title>Color Picker</title> <input name="sel1" type="text" onfocus="colordialog()"> Select color: </textarea> <br><input onclick="runEx('runcode8077')" type="button" value="杩"> </div>