I'm just curious why this doesn't work. If I pass the name 'book1' directly it works, but if I pass it through the function's parameter it doesn't.
Any help would be appreciated. Thanks.
var add_to_page = function(item) {
$('#item .name').text(item.name)
//$('#book1 .name').text(book1.name) //<--- this works!!
};
add_to_page('book1');