Programming Tips - jQuery: Get html select options as an array

Date: 2018jul5 Language: javaScript Library: jQuery Q. jQuery: Get html <select> options as an array A. Use $('#myselect option') like this
function getSelectOptions(id) { let a = []; $('#' + id + ' option').each(function() { a.push($(this).val()); }); return a; }