Browse - programming tips - jquery append to selectDate: 2011dec8 Platform: jQuery Language: javaScript Q. What's the best way to append an <option> to a <select> with jQuery? A. I use this function: function selectAppend(jquerySearch, myvalue, pretty) { $(jquerySearch).append($('<option>', { value : myvalue }).text(pretty)); } example use: selectAppend('#myselect', '1.00', 'One Dollar');
Add a commentSign in to add a comment | Advertisements:
|