I wrote the following code
See example 1 http://pastebin.com/At9NNkB5
extra characters after close-quote
1) I tried to open and close the block using double quotes and add the slash char before each double quote along the code but it doesn't work either.
See example 2 http://pastebin.com/At9NNkB5
2) I tried to use single quotes but that doesn't work as well
Does anyone have any idea how to solve that?
p.s. The code works surely. I wrote the same code within an html to ratify that.
Try moving your JS block to a separate file.