Better with Templates!
Using JavaScript templates, building a list could look something like:
There are a variety of libraries for making templates in JavaScript. I'll mention four here, and we'll focus on one in our examples (Handlebars):
- Handlebars, Handlebars provides the power necessary to let you build semantic templates effectively with no frustration.
- Mustache, "Logic-less" templates
- Trimpath JavaScript Templates (JST)