【发布时间】:2010-06-22 03:14:07
【问题描述】:
大家好,我的 CSS 中有以下样式:
.on_focus {
background-color:yellow;
}
.off_focus {
background-color:white;
}
然后我的表单中有这个输入:
<label>Last Name</label><br/>
<input id="l_name" class="text" type="text" name="l_name" maxlength="20" onfocus="this.className='on_focus'" onblur="this.className='off_focus'"/><br/><br/>
这在 Fire Fox 中效果很好,但在 IE 中根本不起作用。在 IE 中,背景颜色永远不会改变,无论字段是否具有焦点,它始终是白色的。 这是怎么回事?
【问题讨论】:
标签: javascript css internet-explorer firefox