dropdown list jquery -
i have array following value,
[['6','ltr'],['7','ml']]
how can use array fill drop down list using jquery
- demo 2: http://jsbin.com/ewimo4/2
$(function() { var arr = [['6', 'ltr'], ['7', 'ml']]; var html = "<select>"; $.each(arr,function(i, item) { html += '<option value="' + item[0] + '">' + item[1] + '</option>'; }); html += "</select>"; $('#select').html(html); });
- demo : http://jsbin.com/ewimo4
$(function() { var arr = [['6', 'ltr'], ['7', 'ml']]; $.each(arr,function(i, item) { alert(item[0] + ' ' + item[1]); }); });
Comments
Post a Comment