Skip to main content

Bug Tracker

Side navigation

#9545 closed bug (worksforme)

Opened June 08, 2011 05:37AM UTC

Closed June 08, 2011 04:34PM UTC

Last modified June 14, 2011 01:51PM UTC

fail to read attribute in A dom element

Reported by: admin@my-serve.com Owned by:
Priority: low Milestone: 1.next
Component: attributes Version: 1.6.1
Keywords: Cc:
Blocked by: Blocking:
Description

<a href="" id="id" value="aaa">aa</a>

below not reponse

$("#id").attr("value")

$("#id").prop("value")

Attachments (0)
Change History (6)

Changed June 08, 2011 04:34PM UTC by dmethvin comment:1

resolution: → worksforme
status: newclosed

Seems okay to me. The attribute is defined but there is no property named value on a link.

http://jsfiddle.net/uK3kr/

Changed June 08, 2011 04:54PM UTC by timmywil comment:2

component: unfiledattributes
priority: undecidedlow

Changed June 09, 2011 01:12AM UTC by anonymous comment:3

hihi this bug only at 1.6.1

below jquery 1.5.2 all is work.

i test your url but that jquery version is 1.5....

Changed June 09, 2011 04:02PM UTC by dmethvin comment:4

I tested both 1.6 and (edge) again using the fiddle; both seem to work fine. To re-emphasize, it is correct that the *attribute* exists and is retrieved via .attr() but the *property* does not which is why .prop() returns undefined.

Changed June 14, 2011 09:27AM UTC by peizguo comment:5

Replying to [comment:3 anonymous]:

hihi this bug only at 1.6.1 below jquery 1.5.2 all is work. i test your url but that jquery version is 1.5....

Yes, it occurs at 1.6.1 caused by the attrHooks.value.

Please visit http://jsfiddle.net/w9tcq/3/ and see the result at console

Changed June 14, 2011 01:51PM UTC by timmywil comment:6

value is not valid on a cite tag either, but yes. This is intended behavior for value in order to make retrieving value backwards compatible, as you will notice 1.5.2 does the same thing: http://jsfiddle.net/timmywil/w9tcq/4/