Get all options in a select menu
How do I get all the options (text,not the value) of a select menu by by specifying its id
var textArr = $("#mySelect").map(function() {
return $(this).text();
}).get();
alert(textArr);
Demo here. And see http://api.jquery.com/map/
精彩评论