初步判断是obj.style.backgroundColor在FF下返回的是rgb(xxx,xxx,xxx)的缘故。偶是新手,代码很菜,高手勿笑啊 Untitled Document a.blue:link,a.blue:visited{ font-size: 12px; color: #69c; text-decoration: none; } a.blue:hover{ background: #69c; color: #fff; } 关键字 关键字2 关键字3 [Ctrl A 全选 注:如需引入外部Js需刷新才能执行] function fInsert(a,b){ oInput = document.getElementById(a); oItm = b; if(b.style.backgroundColor == "#69c"){ sReplace = oItm.innerHTML.concat(" "); oInput.value = oInput.value.replace(sReplace,""); b.style.backgroundColor = ""; b.style.color = ""; } else{ oInput.value = oInput.value.concat(oItm.innerHTML); oInput.value = oInput.value.concat(" "); b.style.backgroundColor = "#69c"; b.style.color = "#fff"; } }