|
藍森林 http://www.lslnet.com 2006年8月25日 8:28
請教問題
各位,請問有關於輸入顏色代碼出現相應的顏色的網站嗎? |
[html]
<script>
function showc(){
try{
document.all("c").style.backgroundColor=document.all("i").value;
}
catch(e){
alert(e);
}
}
</script>
<div id=c style="width:200;height:200">color</div>
<input type=text id=i value="#FF0000">
<button onclick=showc()>show</button>
[/html]
??? |
非常感謝樓主,很好用 |
|