http://plugins.jquery.com/project/Values

This plugin adds a values() method that searches descendants of the
current selection for those with a "name" attribute and gathers their
values into a hash object for you.  If you pass a hash object or DOM
element into the method, it will reverse the process and set those
values.  It can also work with single values.

This makes it extremely easy to move/set/retrieve values to or from
forms or any random collection of elements, allowing you to focus on
"business" logic and not navigating the DOM to find the elements you
need or worry about how future refactorings will affect things.

To get all values:
var values = $('.parent').values();

To set values:
$('.parent').values({ foo: 'bar', answer: 42 });

To get one value:
var foo = $('.parent').values('foo');

To set one value:
$('.parent').values('foo', 'bar');

More info on the available functions and configuration options are in
the source.  Feedback is welcome.  I'm pretty new to this plugin-dev
thing. :)

Reply via email to