add option to select combobox

To add option to select you can use :

     $('#selectname').append($("").attr("value", value).text(text));
If you need to append multi value you can user:

    $.each(data, function(i, option) {
        $('#selectname').append($('
If you need to add option to first "top" of list use

     $('#sel_bat1').children(":first").before($("").attr("value", value).text(text));

Comments

Popular posts from this blog

C# Crop white space from around the image

Could not load file or assembly 'Microsoft.ReportViewer.Common, Version=xx.0.0.0, Culture=neutral, PublicKeyToken='xxx' or one of its dependencies.

The specified version string contains wildcards, which are not compatible with determinism.