如果在表中的任何td上都没有找到焦点,则任务是采取行动。表格布局存储在jquery 变量中,其布局如下所示
<table class="cal_tbl" cellSpacing="1" cellPadding="3"> <tbody>
<tr>
<td class="cal_head"><<</td>
<td class="cal_head"><</td>
<td class="cal_head" colSpan="3">November 2012</td>
<td class="cal_head">></td>
<td class="cal_head">>></td>
</tr>
<tr>
<td class="cal_subhead">Sun</td>
<td class="cal_subhead">Mon</td>
<td class="cal_subhead">Tue</td>
<td class="cal_subhead">Wed</td>
<td class="cal_subhead">Thu</td>
<td class="cal_subhead">Fri</td>
<td class="cal_subhead">Sat</td>
</tr>
<tr>
<td colSpan="4"></td>
<td class="cal_cell">1</td>
<td class="cal_cell">2</td>
<td class="cal_cell">3</td>
</tr>
<tr>
<td class="cal_cell">4</td>
<td class="cal_cell">5</td>
<td class="cal_cell">6</td>
<td class="cal_cell">7</td>
<td class="cal_cell">8</td>
<td class="cal_cell">9</td>
<td class="cal_cell">10</td>
</tr>
<tr>
<td class="cal_cell">25</td>
<td class="cal_cell">26</td>
<td class="cal_cell">27</td>
<td class="cal_cell">28</td>
<td class="cal_cell">29</td>
<td class="cal_cell">30</td>
</tr> </tbody></table>
我必须检查焦点是否在任何td
以下是我尝试过的代码
if ($(CurrentCalendarButton).children[i].is(":focus") == true)
alert("Keep it on")