我有以下内容html
:
<table id="share">
<tr class="row">
<td class="optionsCell">Share Clip postings : </td>
<td class="cell"><input type="checkbox" id="shareClipPost" /><span>Yes</span></td>
</tr>
<tr class="row">
<td class="optionsCell">Share my favorites : </td>
<td class="cell"><input type="checkbox" id="shareFavorites" /><span>Yes</span></td>
</tr>
<tr class="row">
<td class="optionsCell">Share all ratings given/changed : </td>
<td class="cell"><input type="checkbox" id="shareRating" /><span>Yes</span></td>
</tr>
<tr class="row">
<td class="optionsCell">Share all shows recorded : </td>
<td class="cell"><input type="checkbox" id="shareRecorded" /><span>Yes</span></td>
</tr>
<tr class="row">
<td class="optionsCell">Share all shows viewed : </td>
<td class="cell"><input type="checkbox" id="shareView"/><span>Yes</span></td>
</tr>
</table>
现在我想要实现的是一种合适的方式,以便我可以获取选中或未选中的复选框。最初,我从ajax
请求获得的数据中将复选框标记为选中,其余其他框保持未选中状态。这是我的设置。所以现在我需要找到一种方法来获取用户更改的复选框的值,这些复选框可能是取消选中先前选中的复选框或选中任何未选中的框。然后我只能通过id
已更改的复选框。现在我通过所有id's
的单一变化。