Roland Roland - 1 year ago 83
jQuery Question

Appending Item to dropdown list without selecting the item

I have a form wherr I fill in an item name and immediately after I hit submit the item adds to the select dropdownlist and is automatically selected. Is there a way not to have this newly added item selected?

My code that adds the item looks like this

$("#userGroup_groups").append("<option value="41" selected="selected">item</option>");

Answer Source

remove selected

$("#userGroup_groups").append("<option value=\"41\" >item</option>");
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download