Closed (fixed)
Project:
Drupal core
Version:
8.0.x-dev
Component:
javascript
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
23 May 2012 at 15:37 UTC
Updated:
29 Jul 2014 at 20:43 UTC
In core we still have line like
$("input").attr("disabled", ''); //bad
A least it should be
$("input").attr("disabled", false);
But .prop is made for properties, we should use it. http://api.jquery.com/prop/.
# Careful when you want to set to false.
To set a native property to false use
$("input").prop("disabled", false);
You can not add the property again if you use removeProp on native properties.
$("input").removeProp("disabled", false);
Comments
Comment #1
gagarine commentedSee also #1480568: use $.attr with false instead of empty string
Comment #2
nod_That happened when we upgraded to jQuery 1.9.