JSFiddle - React, Tailwind, and code Playground
HTML
<script src="http://ajax.microsoft.com/ajax/jquery.templates/beta1/jquery.tmpl.js"></script>
<ul id="container"></ul>
<ul id="container2"></ul>
<div id="results"></div>
<script id="tmpl" type="text/html">
<li>${ num }</li>
</script>
<script id="tmpl2" type="text/html">
{{each items}}
<li>${ num }</li>
{{/each}}
<li id="other">${other}</li>
</script>
CSS
ul{
margin-bottom: 10px;
}
JavaScript
$(document).ready(function() {
var items = [
{num: 0},
{num: 1},
{num: 2}
],
wrappedItems = {"items": items, other: "other text"},
results = [];
$("#tmpl").tmpl(items).appendTo("#container");
$("#tmpl2").tmpl(wrappedItems).appendTo("#container2");
results = [
"<p>",
"tmplItem for first item in first container:",
//tmplItem for the first li is the first item in the array
$("#container").children().first().tmplItem().data === items[0],
"</p><p>",
"tmplItem for first item in second container:",
//tmplItem for the first li is the first item in the array
$("#container2").children().first().tmplItem().data === items[0],
"</p><p>",
"tmplItem for other in second container:",
$("#other").tmplItem().data === wrappedItems,
"</p>"
];
$("#results").html(results.join(" "));
});