Like in
Java, inside a JS
string you need to escape the quotes which you already are using to quote the actual string.
I practice myself to use singlequotes only to represent strings in JS. It makes life easier.
E.g.
Edit: the darn forum engine is removing the whole href attribute inside the code block when HTML in message is enabled! Disabling HTML in message .. (again)