工作,我有以下的HTML代码style.visibility JavaScript并不是在IE
<tr id="maxHoursId">
<td>MaxHours</td>
<td><input type="text" name="maxHours" size="5" value=""></td>
<td colspan="8"></td>
</tr>
我打电话以下Java脚本在 ,但元件没有得到隐藏在IE浏览器。它可以在Chrome中正常工作,Firefox
function hideMaxHours() {
var listingType = document.getElementById('listingTypeId').value;
if (listingType == "FullDay") {
var trId = document.getElementById('maxHoursId');
trId.style.visibility = 'hidden';
}
}
如何确保你的是,如果条件是真的吗?由于设置样式为我在IE工程:http://jsfiddle.net/UmL5M/ – nnnnnn 2012-02-24 23:40:47
你说得对,看来控制未在侧去,如果条件反正。那么怎么写比较呢?我已经检查了java教程,并根据它看起来像我所拥有的是正确的 – 2012-02-24 23:47:35
您正在测试什么版本的IE?这在IE9正常工作:http://jsfiddle.net/HH6Wd/ – pete 2012-02-24 23:49:55