我使用这个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?');
}
});
});
现在它做什么,当复选框用户点击,一个确认显示(这很好),当用户点击“确定”按钮时勾选复选框,如果用户点击“取消”按钮(在确认提示上),则该复选框应该保持不勾选。我怎样才能做到这一点?
请帮忙!
感谢Hiral,这是完美的!我在5分钟内接受你的回答,因为这里的系统不允许我接受atm。 非常感谢你的时间。 – user2854563
@ user2854563欢迎您:) – Hiral