【发布时间】:2013-10-20 11:20:48
【问题描述】:
我有一个表格,我想使用以下代码更改第 TH 行的文本颜色:
<select>
<option onclick="document.getElementById('tablehead').style.color=''">Default</option>
<option onclick="document.getElementById('tablehead').style.color='red'">Red</option>
<option onclick="document.getElementById('tablehead').style.color='yellow'">Yellow</option>
<option onclick="document.getElementById('tablehead').style.color='green'">Green</option>
</select>
这在 Firefox 中应该可以完美运行,但是当我在任何其他浏览器中测试它时,它就无法正常工作。我在这里想念什么?
【问题讨论】:
标签: jquery select colors html-table onclick