Hướng dẫn escape quote javascript
Please find in the below code which escapes the single quotes as part of the entered string using a regular expression. It validates if the user-entered string is comma-separated and at the same time it even escapes any single quote(s) entered as part of the string. In order to escape single quotes, just enter a backward slash followed by a single quote like: \’ as part of the string. I used jQuery validator for this example, and you can use as per your convenience. Valid String Examples: 'Hello' 'Hello', 'World' 'Hello','World' 'Hello','World',' ' 'It\'s my world', 'Can\'t enjoy this without me.', 'Welcome, Guest' HTML:
|