This question already has an answer here Javascript Razor and Escape characters Like apostrophe ... Login Register ... How to escape double and single quote from JS string. Note: The All JS Examples codes are tested on the Firefox browser and the Chrome browser. If you want to use more than one in a string, you can. "; You don’t need to escape single-quotes in a double-quote string. JavaScript escape Les caractères spéciaux, sauf @*_+-./, seront encodés. Assign the following three lines of text into the single variable myStr using escape sequences. end single-quoting, double-quote a lone single-quote, then reënter single-quoting). "; This signals to JavaScript that the following quote is not the end of the string, but should instead appear inside the string. JavaScript escape single quote Single quote escaping can become a bit more tricky if you are building a Spring application that makes use of Spring's ResourceBundleMessageSource class. Call Javascript function on pressing ‘Enter’ key January 25, 2008 In "Html". Escape Single Quote In String In