Skip to main content

Bug Tracker

Side navigation

#2558 closed bug (fixed)

Opened March 19, 2008 03:28PM UTC

Closed May 13, 2008 12:30AM UTC

$(...).attr returns different values in IE7 and Firefox

Reported by: oridan Owned by:
Priority: major Milestone: 1.2.4
Component: core Version: 1.2.3
Keywords: Cc:
Blocked by: Blocking:



returns the text contained within the onclick attribute.


returns a reference to an anonymous function.


return text contained within the attribute, as per firefox.

Attachments (0)
Change History (4)

Changed March 19, 2008 03:29PM UTC by oridan comment:1

possibly related to #2511

Changed April 08, 2008 02:00PM UTC by MelTraX comment:2

This 'error' also occurs for IE6.. I'm using a quick fix now which might help you to integrate a proper fix into jQuery:


'onclickValue': function() {

var onclick = this.attr('onclick');


return (onclick+'').substr(23,(onclick+'').length-25);


return onclick;



Changed April 08, 2008 02:02PM UTC by MelTraX comment:3

Hmm.. The italic part should have two (onclick+{emptystring}) and a linebreak was lost but I guess you get the picture ;)

Changed May 13, 2008 12:30AM UTC by flesler comment:4

resolution: → fixed
status: newclosed

This could be patched on .attr(), but would change the behavior for anything else.

To get the text on firefox, just use: this[0].getAttribute('onclick');