Disabled of prop & attr in jquery
I have encountered problems with prop & attr in checkBox before, so I was more cautious with using attr later. However, I encountered another problem when I recently used prop, as described below:
Scenario Description: this function can be used only when the transfer-out button is checked. Otherwise, it is in the gray-disabled state. What is the prZ used this time? Http://www.bkjia.com/kf/ware/vc/ "target =" _ blank "class =" keylink "> vcLT6wuvI58/CPC9wPg0KPHByZSBjbGFzcz0 =" brush: java; ">$ (# SaleBtn). prop (disabled, disabled); // disable $ (# saleBtn). removeProp (disabled); // remove disabled
When I first came in to the page, disabling it worked. However, when I selected a quick redemption protocol and removed the selected protocol, the problem occurred and the above Code no longer worked, very strange.
There are five solutions to this problem:
Method 1:
$ (# SaleBtn). prop (disabled, true); // disable $ (# saleBtn). prop (disabled, false); // remove disabled
Method 2:
$ (# SaleBtn). prop (disabled, disabled); // disable $ (# saleBtn). prop (disabled,); // remove disabled
Method 3:
$ (# SaleBtn). attr (disabled, true); // disable $ (# saleBtn). attr (disabled, false); // remove disabled
Method 4:
$ (# SaleBtn). attr (disabled, disabled); // disable $ (# saleBtn). attr (disabled,); // remove disabled
Method 5:
$ (# SaleBtn). attr (disabled, disabled); // disable $ (# saleBtn). removeAttr (disabled); // remove disabled