Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

jquery remove options from select then add new options

$('#mySelect')
  .empty() /*remove all items*/
  .append('<option value="whatever">text</option>') /*add new items*/
  .val('whatever'); /*set value*/
 
PREVIOUS NEXT
Tagged: #jquery #remove #options #select #add #options
ADD COMMENT
Topic
Name
8+1 =