Skip to main content

Bug Tracker

Side navigation

#13285 closed feature (wontfix)

Opened January 21, 2013 01:44PM UTC

Closed January 21, 2013 07:04PM UTC

Last modified January 21, 2013 08:26PM UTC

Some jQuery's methods should return an array instead of plain text

Reported by: denislins Owned by:
Priority: undecided Milestone: None
Component: unfiled Version: 2.0b1
Keywords: Cc:
Blocked by: Blocking:
Description

Today, when I try to get values from some '<input>' elements with .val(), for example, I get just the value for the first input, and I think that's wrong.

When using .text() and .html(), it returns all values combined, with no choice of the separator, making it hard to work as well.

Fiddles:

http://jsfiddle.net/ZXsqA/ (.text())

http://jsfiddle.net/rjmGH/1/ (.val())

I would suggest that this methods return an array with all values instead of the current behavior, facilitating our work when doing group operations.

Attachments (0)
Change History (5)

Changed January 21, 2013 07:04PM UTC by timmywil comment:1

resolution: → wontfix
status: newclosed
version: git2.0b1

This would change jQuery too drastically.

Changed January 21, 2013 07:34PM UTC by denislins comment:2

I agree, that's why I would suggest that this feature be included in jQuery 2.0. It's a new version, which by itself comes with some major changes, and nobody should upgrade without knowing the changes.

Besides the compatibility problem, I think most users will enjoy this new feature, as the current behavior is, at minimum, unexpected.

Changed January 21, 2013 07:43PM UTC by rwaldron comment:3

that's why I would suggest that this feature be included in jQuery 2.0

While we certainly appreciate your contribution, we also appreciate our roadmap and game plan. The most important note is that jQuery 2.0 and 1.9 will maintain API and semantic parity for many years to come.

Changed January 21, 2013 08:07PM UTC by denislins comment:4

Thank you a lot for your feedback.

Could a .textAll() method be implemented, according to your road map?

Changed January 21, 2013 08:26PM UTC by rwaldron comment:5

Probably not, but this will cover your needs http://jsfiddle.net/rwaldron/aMvMs/