每次我在 i.e10 中运行页面时,JavaScript 调试器窗口都会出现并显示“样式”的未定义错误。我正在尝试 JavaScript 方式而不是 jQuery。
事实证明很麻烦...
var displayPackets = document.getElementById('pnl_emailFtp');
// set style to 'display:none;'
displayPackets.style.display = "none";
var smlPkt = document.getElementById('small-packet');
var lrgPkt = document.getElementById('large-packet');
// Shows the 'panel' where the 'small/Large' pkts are.
var radButton = document.getElementsByName('secureData');
// Check radio button has been clicked and show
// Small/Large packet boxes.
if (radButton.checked = true) {
displayPackets.style.display = "block";
} else {
displayPackets.style.display = "none";
}
难道我做错了什么?