HTML 색상 선택기 범위: #000 - #FFF <!-- .divColor div { float:left; width:5px; height:5px; line-height:0px; font-size:0px; cursor:pointer; } .divColor span { display:block; float:left; width:40px; height:20px; cursor:pointer; } .divColor .clear { height:auto; width:auto; clear:both; font-size:0px; line-height:0px; } --> [Ctrl A 모두 선택 참고: 외부 J를 도입해야 하는 경우 실행하려면 새로 고쳐야 합니다 ]// <![CDATA[ function selectColor(o) { o.style.backgroundColor = '#FFF'; o.style.border = 'solid 10px ' + (o.value == '' ? 'black' : o.value); } function showColor(color) { document.getElementById('txtColor').style.border = 'solid 10px ' + color; } function setColor(color) { var txtColor = document.getElementById('txtColor'); txtColor.value = color; txtColor.style.backgroundColor = color; txtColor.select(); txtColor.focus(); } var c = '0123456789ABCDEF'; for (var r = 0; r < c.length; r++) { var color = '#' + c.charAt(r) + c.charAt(r) + c.charAt(r); document.write('<span onclick="setColor(\'' + color + '\');" onmouseover="showColor(\'' + color + '\');" style="background-color:' + color + ';"> '); } document.writeln('<div style="clear:both; height:5px;">'); var begin = 0; for (var i = 0; i < 2; i++) { begin = i * 8; for (var r = 0; r < c.length; r++) { document.writeln('<div class="clear">'); for (var g = begin; g < begin + 8; g++) { for (var b = 0; b < c.length; b++) { var color = '#' + c.charAt(r) + c.charAt(g) + c.charAt(b); document.write('<div onclick="setColor(\'' + color + '\');" onmouseover="showColor(\'' + color + '\');" style="background-color:' + color + ';">'); } } document.writeln(''); } } // ]]>