Use jQuery's
val
method to set the value of the list after adding the new option.
$("#addFee").click(function(){
var ft = $("#feetypeid").val();
var fm = $("#formonth").val();
$("#theFee").append($("<option/>").val(ft).html(fm)).val(ft);
});
Demo[
^]
NB: Since the
<select>
will only submit the
value of the selected item, it doesn't make sense to have multiple options with the same value. If you do,
val
will select the first option with the specified value.