Opened 15 years ago
Closed 15 years ago
#4215 closed bug (invalid)
Attribute "value" does not work well
Reported by: | markeli | Owned by: | |
---|---|---|---|
Priority: | major | Milestone: | 1.4 |
Component: | core | Version: | 1.3.2 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
Details:
<div id=div_001 value='12'></div> .... $("#div_001").attr("value") returns null
Change History (5)
comment:1 Changed 15 years ago by
comment:2 Changed 15 years ago by
However, using getAttribute works correctly:
http://jquery.nodnod.net/cases/147
I've attached a patch.
comment:3 Changed 15 years ago by
Or rather, I should clarify that getAttribute works on Firefox, but is buggy on other browsers, so the patch will have to wait until someone thinks of a way to feature-detect proper getAttribute support.
comment:4 Changed 15 years ago by
Actually, nevermind. Using $().attr() works:
http://jquery.nodnod.net/cases/148
Looks like this is because .val() falls back to using element.value which doesn't work in cases liket his.
comment:5 Changed 15 years ago by
Resolution: | → invalid |
---|---|
Status: | new → closed |
Note: See
TracTickets for help on using
tickets.
Test case:
http://jquery.nodnod.net/cases/146
But looks like this is related to ticket #4160