Reputation: 339
I have a table with a column of pre-populated text inputs:
<table><tr><td>...</td><td><input class="unique_class" value="value1"/></td></tr>...
I gave each input box the same css class that only that element has (unique_class). I was hoping that I could use jQuery.val() to grab an array of all the input values with the css class in the table like this (I have done something similar with checkbox values):
var values = $('.unique_class').val();
However, I only am getting the value of the last input in the table. Is there a simple 'fast' way to this without a for-loop iteration? This table can get be very large (100+ rows)?
Upvotes: 3
Views: 743