View page source and see how the quote was generated in the value attribute above.
Didn't need entity reference above, just wanted to show it to you.
View page source and tell me why I HAD to you a single quote when I concatenated the \n into the alert string.