Commit e61af3f
authored
Docs: Improve the solution for
Because jQuery 4.0.0 will not transform attribute values in the getter, the
following code changes between jQuery 3.x & 4.x:
```js
$( elem ).prop( "disabled", true );
$( elem ).attr( "disabled" );
```
In jQuery 3.x, the reported attribute value is `"disabled"`, in jQuery 4.x it
will be an empty string. This may create issues when migrating so Migrate
patches and warns against it.
Add a recommendation to avoid using the `.attr()` getter on boolean attrs.
Closes gh-588boolean-attributes
1 parent 1a36394 commit e61af3f
1 file changed
+1
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
56 | 56 | | |
57 | 57 | | |
58 | 58 | | |
59 | | - | |
| 59 | + | |
60 | 60 | | |
61 | 61 | | |
62 | 62 | | |
| |||
0 commit comments