Ticket #7443 (closed feature: invalid)
Make .text()/.val() interchangable
| Reported by: | john | Owned by: | john |
|---|---|---|---|
| Priority: | low | Milestone: | 1.next |
| Component: | attributes | Version: | 1.5 |
| Keywords: | Cc: | ||
| Blocking: | Blocked by: |
Description (last modified by john) (diff)
Right now there is a lot of confusion over when to use .text() or .val(). We could simplify it by making it such that .text() will set the value of input elements and textareas. No reason not to.
Change History
comment:1 Changed 3 years ago by john
- Owner set to john
- Status changed from new to assigned
- Component changed from unfiled to attributes
comment:3 Changed 3 years ago by rwaldron
- Keywords needsdocs added
- Priority changed from undecided to low
comment:5 Changed 3 years ago by dmethvin
Also, consider the XML/XHTML case in the code; this magic is only intended for HTML DOM documents that have a documented value property, right? And there's #6478 that will break the proposed .text() method.
comment:6 Changed 2 years ago by etiger13
A reason not to would be that it promotes using .text() to set the value of an input. Users could start thinking that it sets the value for everything, including <option>s, which is not the case. .text sets the text of an element and .val sets the value. Simple to understand. Just because we can promote bad coding standards doesnt mean its the right thing to do
comment:7 Changed 2 years ago by jitter
- Status changed from assigned to pending
- Version changed from 1.4.3 to 1.5
- Milestone set to 1.next
I also think there is no real need to do this, do we still want to do this? John?
comment:8 Changed 2 years ago by trac-o-bot
- Status changed from pending to closed
- Resolution set to invalid
Because we get so many tickets, we often need to return them to the initial reporter for more information. If that person does not reply within 14 days, the ticket will automatically be closed, and that has happened in this case. If you still are interested in pursuing this issue, feel free to add a comment with the requested information and we will be happy to reopen the ticket if it is still valid. Thanks!
Please follow the bug reporting guidlines and use jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.
