Bug Tracker


Ticket #10360 (closed bug: invalid)

Opened 3 years ago

Last modified 3 years ago

The Attribute Equals Selector doesn't seem to work with "hash"

Reported by: evan@… Owned by:
Priority: low Milestone: None
Component: attributes Version: 1.6.3
Keywords: Cc:
Blocking: Blocked by:


The attribute equals selector doesn't seem to work with "hash"; it returns "undefined". Accessing it directly via the DOM element works.

See example here:  http://jsfiddle.net/XnDyh/

I discovered this when I was trying to track down why jQTouch wasn't working as expected with me, and I saw in the source code that the author was using $el.attr('hash') to determine if a link had a hash or not. Changing this to $el[0].hash fixes all my issues with jQTouch.

Tested with jQuery 1.6.2 & 1.6.3 & edge (latest version available on JSFiddle)

Change History

comment:1 Changed 3 years ago by evan@…

I forgot to mention this does work in the JSFiddle example with jQuery 1.5.2.

comment:2 Changed 3 years ago by evan@…

Nevermind; forgot about .prop(), which seems to work. I'll file a bug fix with the author of jQTouch. Feel free to close this ticket.

comment:3 Changed 3 years ago by addyosmani

  • Priority changed from undecided to low
  • Resolution set to invalid
  • Status changed from new to closed
  • Component changed from unfiled to attributes

Closing at the request of the original ticket submitter. .prop() should indeed be used here.

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


Add a comment

Modify Ticket

as closed

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

Note: See TracTickets for help on using tickets.