Jquery Asp.net button disable

前端 未结 6 691
时光说笑
时光说笑 2021-02-09 14:42

html code:


Jquery Code:

$(\'[id$=b         


        
6条回答
  •  情歌与酒
    2021-02-09 15:24

    Try to use jQuery class selector:

    1. Add CssClass="MyButton" to your ASP.NET button;
    2. Use this selector in jQuery
    3. Set disabled="disabled" attribute on click

    jQuery:

    $('button.MyButton').click(function(){ 
      $(this).attr('disabled', 'disabled');
    });
    

提交回复
热议问题