learn.knockoutjs.com - Working with templates and lists
http://learn.knockoutjs.com/#/?tutorial=templates
HTML
<link rel="stylesheet" href="http://learn.knockoutjs.com/Content/App/coderunner.css">
<link rel="stylesheet" href="http://learn.knockoutjs.com/Content/TutorialSpecific/templates.css">
<script src="http://github.com/downloads/SteveSanderson/knockout/knockout-2.1.0.js"></script>
<script type="text/html" id="userPicture-template">
<p data-bind="text: testText"></p>
</script>
<div data-bind="foreach: voters" >
<div>
<div data-bind="template: { name: 'userPicture-template', data: $data }">
</div>
</div>
</div>
JavaScript
ko.applyBindings({
voters: [
{ testText: "hello" },
{ testText: "world" },
]
});