I have a ul with id ul1. In the UL I have 3 li, each containing a textbox. How do I read each and every li of the ul to retrieve the values of the textbox in the li and put them in an array?
+4
A:
It's as simple as this:
var values = [];
$('#ul1 li textarea').each(function() {
values.push($(this).val());
});
Tatu Ulmanen
2010-02-16 10:51:34
+3
A:
Should be enough
var values = $( "#ul1 textarea").map( function( )
{
return $(this).val( );
}).get( );
Artem Barger
2010-02-16 10:51:55