Bug Tracker

Ticket #4215 (closed bug: invalid)

Opened 6 years ago

Last modified 6 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:

Description

Details:

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

Change History

comment:1 Changed 6 years ago by dz

Test case:

 http://jquery.nodnod.net/cases/146

But looks like this is related to ticket #4160

comment:2 Changed 6 years ago by dz

However, using getAttribute works correctly:

 http://jquery.nodnod.net/cases/147

I've attached a patch.

comment:3 Changed 6 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 6 years ago by dz

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 6 years ago by dmethvin

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