Here is the script that did it.

<FORM>
<INPUT TYPE="button" VALUE="Hex Coder" ONCLICK="
var cc=
prompt('Enter desired color .')
document.bgColor=cc;
alert(document.bgColor)">
</FORM>