Skip to main content

Bug Tracker

Side navigation

#12631 closed bug (notabug)

Opened September 29, 2012 12:40AM UTC

Closed October 01, 2012 03:30PM UTC

attr no longer seems to work

Reported by: Owned by:
Priority: undecided Milestone: None
Component: unfiled Version: 1.8.2
Keywords: Cc:
Blocked by: Blocking:

Since upgrading to jQuery v1.8.2, I am noticing problems with my web site and these usually seem to relate to the use of .attr.

For example, $(this).attr('id') or $(IdOfField).attr('class') is not retrieving the id or class.

Is this a bug?

Attachments (0)
Change History (10)

Changed September 29, 2012 12:43AM UTC by rwaldron comment:1

owner: →
status: newpending

Thanks for taking the time to contribute to the jQuery project! Please provide a complete reduced test case on jsFiddle to help us assess your ticket!

Additionally, be sure to test against the "jQuery (edge)" version to ensure the issue still exists. To get you started, use this boilerplate:

Open the link and click to "Fork" (in the top menu) to begin.

Changed October 01, 2012 07:38AM UTC by comment:2

I encountered this bug as well: $(this).attr('class') returns the jQuery object of $(this), not the attribute string. I can in some cases avoid this by getting the DOM property with .prop() instead of the attribute string, but this is not always desirable.

Changed October 01, 2012 07:52AM UTC by comment:3

Apparently this is not jQuery v1.8.2 bug since I am encountering it on 1.7.2 as well. This happens on Chrome 22.0.1229.79 m but not on latest Firefox. Maybe a Chrome bug?

Changed October 01, 2012 07:58AM UTC by comment:4

No wait, it happens on Firefox too, my bad... But it happens in 1.7.2 as well. 1.6.4 works fine.

Changed October 01, 2012 08:01AM UTC by comment:5

I found a related comment in release notes page.

Changed October 01, 2012 08:05AM UTC by comment:6

Fixed link directly to the comment in question... 1.7.2 release notes page.

Changed October 01, 2012 08:15AM UTC by comment:7

I believe this ticket is invalid. TinyMCE breaks .attr for jQuery 1.7.2+ before version 3.5.4. So updating TinyMCE fixes this.

Changed October 01, 2012 12:24PM UTC by mikesherov comment:8

Thanks! We suspect the same too but we'll wait to see if Stephen can produce a test case before closing this bug.

Changed October 01, 2012 02:24PM UTC by anonymous comment:9

I am using TinyMCE v.3.4.2, and the previous version of jQuery that I was using was 1.7.1. I have had to revert to 1.7.1 because of this problem. I will have a look at upgrading TinyMCE. Was that just a guess that I was using TinyMCE, or is this problem specifically related to the use of TinyMCE?


Changed October 01, 2012 03:30PM UTC by mikesherov comment:10

resolution: → notabug
status: pendingclosed

Related to TinyMCE specifically.