I'm append html code using jquery append function. If on onclick I use function with one parameter - all right, but if I use function with multiple parameters I get error in console: SyntaxError: missing ) after argument list. My code:
var quote = quotes[i];
$('#quu').append('<div onclick="addBook('+quote.userId+', '+quote.book+')">'+quote.book+'</div>')
Function addBook:
function addBook(user_id, name) {
alert(name);
alert(user_id);
}
What I'm doing wrong?