jquery adding in select list by textbox

Posted by mazhar on Stack Overflow See other posts from Stack Overflow or by mazhar
Published on 2010-05-13T21:35:26Z Indexed on 2010/05/13 22:24 UTC
Read the original article Hit count: 160

Filed under:

ok what i am trying to do is to add something in the textbox and after pressing the add button it should go into the select list. how would i do that with jquery?

I am not really able to make it work by your method .Please help? What i am doing wrong

<%= Html.ListBox("FeatureLists", ViewData["FeatureListListBox"] as MultiSelectList)%>

$("#add").click(function() { var val = $("#txtaddfeature").val(); alert("aaa"); $("", { 'value': val, text: val }).appendTo("#FeatureLists"); //$("#textbox").val(''); here if you want to clear the value for next time });

© Stack Overflow or respective owner

Related posts about jQuery