How to disable/enable input field on click with jQuery

后端 未结 7 751
慢半拍i
慢半拍i 2020-12-31 13:36

How to properly enable/disable input field on click with jQuery?

I was experimenting with:

$(\"#FullName\").removeAttr(\'disabled\');
7条回答
  •  挽巷
    挽巷 (楼主)
    2020-12-31 14:12

    $("#anOtherButton").click(function(){
      $("#FullName").attr('disabled', 'disabled'); 
     });
    

    • .attr( attributeName, value) function

      Set one or more attributes for the set of matched elements

提交回复
热议问题