disable a hyperlink using jQuery

后端 未结 11 1696
悲&欢浪女
悲&欢浪女 2020-11-29 02:06
Click me

I did

$(\'.my-link\').attr(\'disabled\', true);
11条回答
  •  甜味超标
    2020-11-29 02:51

    function EnableHyperLink(id) {
            $('#' + id).attr('onclick', 'Pagination("' + id + '")');//onclick event which u 
            $('#' + id).addClass('enable-link');
            $('#' + id).removeClass('disable-link');
        }
    
        function DisableHyperLink(id) {
            $('#' + id).addClass('disable-link');
            $('#' + id).removeClass('enable-link');
            $('#' + id).removeAttr('onclick');
        }
    
    .disable-link
    {
        text-decoration: none !important;
        color: black !important;
        cursor: default;
    }
    .enable-link
    {
        text-decoration: underline !important;
        color: #075798 !important;
        cursor: pointer !important;
    }
    

提交回复
热议问题