BE ADD THE VALUE IN DROPDOWN LIST

Vikas Giri

Total Post:13

Points:91
Posted by  Vikas Giri
JQuery 
 2561  View(s)
Ratings:
Rate this:
I want to add the value in dropdown list by using textbox in jquery
give the syntax in jquery
  1. Awadhendra Tiwari

    Post:126

    Points:882
    Re: Be add the value in dropdown list

    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

Answer

NEWSLETTER

Enter your email address here always to be updated. We promise not to spam!