Created
February 28, 2014 11:55
-
-
Save nanasess/9269850 to your computer and use it in GitHub Desktop.
example for map.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(function() { | |
var $select = $('<select name="test" />'); | |
var arr = [{'name':'Pizza'},{'name':'Pasta'},{'name':'Pizza2'}]; | |
$select.append(arr.map(function(v, i, obj) { | |
return '<option value="' + i + '">' + v.name + '</option>'; | |
})); | |
window.console.log($select); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment