Created
May 10, 2011 00:50
-
-
Save boscomonkey/963740 to your computer and use it in GitHub Desktop.
JavaScript code to iterate over an array and add its item values to an ordered list and append to a div
This file contains hidden or 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 iterateOver(arry, div) { | |
var ol = $(document.createElement("ol");); | |
ol.class("records_list"); | |
div.append(ol); | |
$.each(arry, function(i, item) { | |
ol.append("<li>" + item.value + "</li>"); | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment