Programming Tips - jQuery: the best way to append an option to a select

Date: 2011dec8 Platform: web Libary: jQuery Language: javaScript Q. jQuery: the best way to append an <option> to a <select> A. This function does it
function selectAppend(jquerySearch, myvalue, pretty) { $(jquerySearch).append($('<option>', { value : myvalue }).text(pretty)); }
Example use:
selectAppend('#myselect', '1.00', 'One Dollar');