Home > DeveloperSection > Forums > Be add the value in dropdown list
Vikas Giri
Vikas Giri

Total Post:13

Points:91
Posted on    January-29-2011 8:04 AM

 JQuery JQuery 
Ratings:


 1 Reply(s)
 2336  View(s)
Rate this:
I want to add the value in dropdown list by using textbox in jquery
give the syntax in jquery


Awadhendra Tiwari

Total Post:126

Points:882
Posted on    May-20-2011 8:51 AM

Hi...

Use following code snippet to add value in dropdown list using jquery

function addCombo() {
var optName = $("#other").attr("value");
$
('#category').append("<option value='"+ optName + "'>" + optName + "</option>");
$
("#other").attr("value", "");
}

Here other is id of drop down list


Don't want to miss updates? Please click the below button!

Follow MindStick