jquery禁用a标签,jquery禁用按钮click点击
转载
01 |
$(document).ready( function () { |
02 |
$( "a" ).each( function () { |
03 |
var textValue = $( this ).html(); |
04 |
if (textValue == "XX概况" || textValue == "服务导航" ) { |
05 |
$( this ).css( "cursor" , "default" ); |
06 |
$( this ).attr( 'href' , '#' ); |
07 |
$( this ).click( function (event) { |
08 |
event.preventDefault(); |
1 |
$( 'a.tooltip' ).live( 'click' , function (event) { |
3 |
event.preventDefault(); |
jquery禁用a标签方法3
2 |
$( '.disableCss' ).removeAttr( 'href' ); |
3 |
$( '.disableCss' ).removeAttr( 'onclick' ); |
jquery控制按钮的禁用与启用
控制按钮为禁用:
1 |
$( '#button' ).attr( 'disabled' , "true" );添加disabled属性 |
2 |
$( '#button' ).removeAttr( "disabled" ); 移除disabled属性 |