Ticket #4046 (closed bug: worksforme)
.attr("value") 1.2.6 versus 1.3.1
| Reported by: | bdenosky | Owned by: | |
|---|---|---|---|
| Priority: | major | Milestone: | 1.3.2 |
| Component: | unfiled | Version: | 1.3.1 |
| Keywords: | Cc: | ||
| Blocking: | Blocked by: |
Description
xhtml snippet: <p id="bpUsername"><input name="bpUsername" type="text"/></p>
jquery snippet: alert($("#bpUsername input").attr("value"));
The value is returned correctly in 1.2.6
Upgrading to 1.3.1 resulted in a returned value of "undefined"
Change History
comment:2 Changed 4 years ago by bdenosky
It is being served up as application/xml+xhtml.
If the alert is set to fire after information has been entered into the input field, that's when the error is produced in 1.3.1. In 1.2.6, the value inputted into the field is displayed.
comment:3 Changed 4 years ago by bdenosky
Firefox, Chrome, Safari and IE7 all behaved the same with regards to this bug.
Please follow the bug reporting guidlines and use jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

It seems to return an empty string in both versions for me. Is there a particular browser that returns the incorrect value?
Are you serving up this document as application/xml+xhtml ? I wonder if that might cause it to return undefined, or whether it's significant that the markup has no value attribute.