jquery禁用a标签,jquery禁用按钮click点击

Posted hupan508

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了jquery禁用a标签,jquery禁用按钮click点击相关的知识,希望对你有一定的参考价值。

jquery禁用a标签方法1

$(document).ready(function () {
        $("a").each(function () {
            var textValue = $(this).html();
            if (textValue == "XX概况" || textValue == "服务导航") {
                $(this).css("cursor", "default");
                $(this).attr(href, #);     //修改<a>的 href属性值为 #  这样状态栏不会显示链接地址  
                $(this).click(function (event) {
                    event.preventDefault();   // 如果<a>定义了 target="_blank“ 需要这句来阻止打开新页面
                });
            }
        });
});

jquery禁用a标签方法2

$(a.tooltip).live(click, function(event) {
   alert("抱歉,已停用!");  
  event.preventDefault();   
});

jquery禁用a标签方法3

$(function(){
$(.disableCss).removeAttr(href);//去掉a标签中的href属性
$(.disableCss).removeAttr(onclick);//去掉a标签中的onclick事件
});

jquery控制按钮的禁用与启用

$(#button).attr(disabled,"true");添加disabled属性 
$(#button).removeAttr("disabled"); 移除disabled属性

 

以上是关于jquery禁用a标签,jquery禁用按钮click点击的主要内容,如果未能解决你的问题,请参考以下文章