Reputation: 1164
Im new to jquery, and what im trying to do is add new option to a dropdownlist. Here what I have so far. Could somone explain what im doing wrong?
<asp:DropDownList ID="drop_company" runat="server"/>
These dont work:
$("#drop_company").append($("<option>").val("this"));
or
$("#drop_company").append($("<option value="1">Apple</option>"));
Upvotes: 0
Views: 74
Reputation: 79830
Try,
$("#drop_company").append('<option value="1">Apple</option>');
$
in ("#drop_company")
Upvotes: 1