我使用這個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