Friday, October 31, 2014

jQuery, get value from cell




jQuery, get value from cell
1. Case 1
html:
 <td class='type'>car</td>
jQuery
var row = $(this).parent().parent();
var type = row.find('td.type').html();

2. Case 2
html
<td class='button1'> <input class='courses_offered_id'/></td>
jQuery
row.find('td input.courses_offered_id').val();

3. Case 3
html
 <td class='Ta'><select id="mySelect"><option value=" ">=No TA Assigned=</option></select></td>
jQuery
row.find('td.Ta select').val();

No comments:

Post a Comment