禁用jQuery的,我有以下的HTML代碼需要在點擊
<div class='login'><a href='#'>Log in</a> to create custom dashboard</div>
這是我的jQuery代碼
$(".login").click(function() {
$(this).children('a').removeAttr("href");
$(this).attr('class','disabledlogin');
..............
}
所以,當我「登錄」鏈接對話框中單擊上出現,我需要禁用「登錄」鏈接。但即使我更改了類屬性,我也可以點擊並打開另一個登錄對話框。問題是什麼?
使用jQuery.unbind()解除鏈接中的單擊事件:) – 2013-04-11 16:12:58
您的jQuery是否包裝在document.ready調用中? – j08691 2013-04-11 16:13:15