Side navigation
#5252 closed bug (invalid)
Opened September 16, 2009 08:47AM UTC
Closed September 24, 2009 03:18AM UTC
attr adding an event to an input field does not work in IE but does in Firefox
Reported by: | johnH | Owned by: | |
---|---|---|---|
Priority: | major | Milestone: | 1.4 |
Component: | unfiled | Version: | 1.3.2 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
Using $(":input").attr("onfocus","alert(this.id);"); to add an event action to an input field will work in Firefox but not in IE (version 8.0.6001). Please see attached example.
Is there a reason that you would want to do it this way instead of the event methodology in jQuery?
Here's how you should be doing it:
More information is available in the Events section of the documentation:
http://docs.jquery.com/Events