我有一个日历的表格行,我需要根据月份打开和关闭。
HTML:
<tr id="bottomrow" class="week" valign="top" style="display:none;">
<td class="day" id="d36">
<div class="daynumb" id="x36"></div>
</td>
<td class="day" id="d37">
<div class="daynumb" id="x37"></div>
</td>
<td class="day" id="d38">
<div class="daynumb" id="x38"></div>
</td>
<td class="day" id="d39">
<div class="daynumb" id="x39"></div>
</td>
<td class="day" id="d40">
<div class="daynumb" id="x40"></div>
</td>
<td class="day" id="d41">
<div class="daynumb" id="x41"></div>
</td>
<td class="day" id="d42">
<div class="daynumb" id="x42"></div>
</td>
</tr>
我尝试使用document.getElementByID('bottomrow').style.display = "none";
,但它似乎没有工作......
JavaScript:
function february() {
document.getElementById('bottomrow').style.display = "none";
var numbdays = 28,
offset = 5;
for (var date = 1; date <= numbdays; date++) {
document.getElementById("x" + (date + offset)).innerHTML = date;
}
}
当页面加载时,该行仍然可见。我究竟做错了什么?