我正在使用这个 HTML:
<tr>
<td class="smalltext" width="100%">
<label>
<input type="checkbox" value="1" name="guarantee" id="guarantee_check_tick" />
— Tick this checkbox if you are going to give 100% satisfaction guarantee.
</label>
</td>
</tr>
和 jQuery:
jQuery(document).ready(function($)
{
$("#guarantee_check_tick").click(function()
{
var $this = $(this);
if ($this.is(":checked"))
{
confirm('Are you sure you are going to provide 100% satisfaction guarantee?');
}
});
});
现在它的作用是,当用户单击复选框时,会显示确认(这很好),并且当用户单击“确定”按钮时会勾选复选框,如果用户单击“取消”按钮(在确认提示时)然后复选框应保持未选中状态。我怎样才能做到这一点?
请帮忙!