Skip to main content

Bug Tracker

Side navigation

#9328 closed bug (fixed)

Opened May 18, 2011 04:18AM UTC

Closed May 18, 2011 05:11AM UTC

Last modified June 21, 2011 11:11PM UTC

1.6.1 .attr() and "value"

Reported by: anonymous Owned by:
Priority: low Milestone: 1.next
Component: attributes Version: 1.6.1
Keywords: Cc:
Blocked by: Blocking:
Description

<div value="1" class="test"></div>

$(".test").val() is ""

$(".test").attr("value") is undefined

$(".test").prop("value") is undefined

but if

<input value="2" class="test2"></input>

everything is fine

how to get "value" at div?

Attachments (0)
Change History (3)

Changed May 18, 2011 05:11AM UTC by rwaldron comment:1

component: unfiledattributes
priority: undecidedlow
resolution: → invalid
status: newclosed

There is no "value" attribute for DIV elements.

http://dev.w3.org/html5/spec/Overview.html#global-attributes

Changed May 18, 2011 03:29PM UTC by timmywil comment:2

resolution: invalidfixed

Make the value hook less obtrusive for elements which do not inherently have a value property. Fixes #9328.

Changeset: ba90af0dc5b279d785e49ff5c051073d2178d372

Changed June 21, 2011 11:11PM UTC by rwaldron comment:3

#9642 is a duplicate of this ticket.