#9545 closed bug (worksforme)
fail to read attribute in A dom element
Reported by: | 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")
Change History (6)
comment:1 Changed 12 years ago by
Resolution: | → worksforme |
---|---|
Status: | new → closed |
comment:2 Changed 12 years ago by
Component: | unfiled → attributes |
---|---|
Priority: | undecided → low |
comment:3 follow-up: 5 Changed 12 years ago by
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....
comment:4 Changed 12 years ago by
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
.
comment:5 Changed 12 years ago by
Replying to 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
comment:6 Changed 12 years ago by
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/
Seems okay to me. The attribute is defined but there is no property named
value
on a link.http://jsfiddle.net/uK3kr/