let say i have a , i want to add some optgroup and option which will be like this
http://jsfiddle.net/ZP4E9/
This is for empty default select options and add new
var select_option = ''; for (i=0; i'+i+'' } $('.selectclassname').html('').append(select_option)