Opened 11 years ago
Closed 10 years ago
#11735 closed feature (duplicate)
Remove the .attr("value") attrHook
Reported by: | dmethvin | Owned by: | Timmy Willison |
---|---|---|---|
Priority: | blocker | Milestone: | 1.9 |
Component: | attributes | Version: | 1.7.2 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
This hook was deprecated in 1.7 and can be removed in 1.8.
To get or set the dynamic, possibly-user-changed value, use .prop("value")
or (preferred) .val()
.
Once this is landed: To get the value attribute on the HTML element, use .attr("value")
.
Change History (10)
comment:1 Changed 11 years ago by
Component: | unfiled → attributes |
---|---|
Milestone: | None → 1.8 |
Priority: | undecided → low |
Status: | new → open |
comment:2 Changed 11 years ago by
comment:4 Changed 11 years ago by
Owner: | set to Timmy Willison |
---|---|
Status: | open → assigned |
comment:6 Changed 11 years ago by
Milestone: | 1.8 → 1.9 |
---|
Looking into this more, the value attribute is very fleeting in IE6/7. These browsers try very hard not to give you the attribute rather than the property, even when using attribute nodes. Internally, I'd guess it has something to do with the value attribute corresponding to the defaultValue property rather than the value property (which I also tried but it was worse). The main problem is that if the value attribute is set on pageload, the specified property for value attribute nodes works fine. However, if it has not been set and is set with js, the specified property will continue to be false and be unreliable. This has happened with other attributes and we've simply checked for empty string to see if we should return a value. This solution won't work for value since value=""
is not at all uncommon to see on option elements. I don't think we'll have a clean solution before the beta so moving to 1.9.
comment:7 Changed 11 years ago by
Type: | enhancement → feature |
---|
Bulk change from enhancement to feature.
comment:8 Changed 10 years ago by
Priority: | low → blocker |
---|
comment:10 Changed 10 years ago by
Resolution: | → duplicate |
---|---|
Status: | assigned → closed |
Duplicate of #12600.
#11535 is a duplicate of this ticket.