Adsense
Popular Posts
- Install APXS in Redhat Linux
- MySQL workbench -"Could not decrypt password cache"
- Transfer modules between sites
- JavaScript, remove trailing insignificant zeros after toFixed function
- Set Windows path command line
- datatable order by nunmeric
- MySQL date created and date modified
- super(props) in React
- PHP, dump varailbes in a format way
- React: connect(mapStateToProps, mapDispatchToProps)
Wednesday, November 21, 2018
Get the dropdown list value and list in JQuery
I have a dropdown list class TaList in a column in a table.
To get the option value of dropdown list in JQuery:
row3.find('td.TaList select').val();
To get the selected text of dropdown list in JQuery:
stakeholder_name1 = row3.find('td.TaList :selected').text();
More codes:
$('div.ajax_list').find("#defaultTable").find('tr').each(function() {
if($(this).find('.swap_option').attr('checked') == 'checked') total += 1;
var row3= $(this);
if(total==1 && $(this).find('.swap_option').attr('checked') == 'checked'){
courses_offered_id1=row3.find("input.courses_offered_id").val();
stakeholder_id1 = row3.find('td.TaList select').val();
stakeholder_name1 = row3.find('td.TaList :selected').text();
section1 = row3.find('.TutSection').html();
assignedID1 = row3.find('.assignedID').val();
}
if(total==2 &&$(this).find('.swap_option').attr('checked') == 'checked'){
courses_offered_id2=row3.find("input.courses_offered_id").val();
stakeholder_id2 = row3.find('td.TaList select').val();
assignedID2 = row3.find('.assignedID').val();
stakeholder_name2 = row3.find('td.TaList :selected').text();
section2 = row3.find('.TutSection').html();
}
});
Labels:
dropdown list,
jQuery
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment