Skip to content
Advertisement

jQuery append onclick

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:

JavaScript

Function addBook:

JavaScript

What I’m doing wrong?

Advertisement

Answer

You need to add quotes to the name quote.book since it shall be passed as a string parameter to the function addBook

JavaScript

JavaScript
JavaScript
User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement