Playing With jQuery
Goals
Overview
Steps
Step 1
var itemTemplate = $('#templates .item') var list = $('#list')Step 2
var addItemToPage = function(itemData) { var item = itemTemplate.clone() item.attr('data-id',itemData.id) item.find('.description').text(itemData.description) if(itemData.completed) { item.addClass('completed') } list.append(item) }var orange = { description: 'Orange', id: 9000, completed: false } addItemToPage(orange)
Explanation
Next Step:
Go on to Creating A List