Bug Tracker

Modify

Ticket #11735 (closed feature: duplicate)

Opened 13 months ago

Last modified 5 months ago

Remove the .attr("value") attrHook

Reported by: dmethvin Owned by: timmywil
Priority: blocker Milestone: 1.9
Component: attributes Version: 1.7.2
Keywords: Cc:
Blocking: Blocked by:

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

comment:1 Changed 13 months ago by dmethvin

  • Priority changed from undecided to low
  • Status changed from new to open
  • Component changed from unfiled to attributes
  • Milestone changed from None to 1.8

comment:2 Changed 12 months ago by dmethvin

#11535 is a duplicate of this ticket.

comment:3 Changed 12 months ago by dmethvin

#9830 is a duplicate of this ticket.

comment:4 Changed 12 months ago by timmywil

  • Owner set to timmywil
  • Status changed from open to assigned

comment:5 Changed 11 months ago by timmywil

#11355 is a duplicate of this ticket.

comment:6 Changed 11 months ago by timmywil

  • Milestone changed from 1.8 to 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 9 months ago by dmethvin

  • Type changed from enhancement to feature

Bulk change from enhancement to feature.

comment:8 Changed 6 months ago by gibson042

  • Priority changed from low to blocker

comment:9 Changed 6 months ago by dmethvin

This hook should be moved to the compat plugin.

comment:10 Changed 5 months ago by gibson042

  • Status changed from assigned to closed
  • Resolution set to duplicate

Duplicate of #12600.

Please follow the  bug reporting guidlines and use  jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

View

Add a comment

Modify Ticket

Action
as closed
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.