Bug Tracker

Ticket #4215 (closed bug: invalid)

Opened 7 years ago

Last modified 7 years ago

Attribute "value" does not work well

Reported by: markeli Owned by:
Priority: major Milestone: 1.4
Component: core Version: 1.3.2
Keywords: Cc:
Blocking: Blocked by:



<div id=div_001 value='12'></div> .... $("#div_001").attr("value") returns null

Change History

comment:1 Changed 7 years ago by dz

Test case:


But looks like this is related to ticket #4160

comment:2 Changed 7 years ago by dz

However, using getAttribute works correctly:


I've attached a patch.

comment:3 Changed 7 years ago by dz

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 7 years ago by dz

Actually, nevermind. Using $().attr() works:


Looks like this is because .val() falls back to using element.value which doesn't work in cases liket his.

comment:5 Changed 7 years ago by dmethvin

  • Status changed from new to closed
  • Resolution set to invalid
Note: See TracTickets for help on using tickets.