In internet explorer how do I escape single quotes.
'
works for firefox etc but internet explorer doesn't like it.
For instance
<input type="text" value='Single quotes `'` Here' />
works in firefox but not in IE
In internet explorer how do I escape single quotes.
'
works for firefox etc but internet explorer doesn't like it.
For instance
<input type="text" value='Single quotes `'` Here' />
works in firefox but not in IE
As AJM said in a comment, I'd try this:
<input type="text" value='Single quotes ' Here' />
' is not valid HTML - it is an XML only sequence. FireFox is simply sharing a little too much code between its html and xml parser. Use the ' sequence (the correct html escape for ') as already suggested.
Use '
You can view a list of all the ISO-8859-1 HTML entities (escape codes) here.
You could surround that particular attribute value with double quotes, and put the single quote in directly.
It appears, also, that some versions of Internet Explorer (correctly) don't recognize the '
entity in HTML, only in XML, so you may have some luck with '
.