Commit 1436296
committed
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 jquerygh-588
(cherry picked from commit e61af3f)boolean-attributes
1 parent 562c10a commit 1436296
1 file changed
+1
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
125 | 125 | | |
126 | 126 | | |
127 | 127 | | |
128 | | - | |
| 128 | + | |
129 | 129 | | |
130 | 130 | | |
131 | 131 | | |
| |||
0 commit comments