Friday, April 12, 2024

How to get the value of dropdown multiselect and shown into label HTML and Javascript

 <select id="ddlBranch" multiple="multiple" class="form-select form-select-sm form-control"></select>


var BrList = [];

 $.each($("#ddlBranch option:selected"), function () {

        BrList.push($(this).text());

    });


$("#lblBranch").text(BrList.join(","));

No comments:

Post a Comment