how to encode apostrophes for a webpage

leora picture leora · May 23, 2011 · Viewed 16.1k times · Source

i am using the cluetip plugin and the simple use case is to to put the content in a title attribute, like below:

<a title='Top title|detail content'>Text</a>

i am now running into issues where the string that is inside "detail content' has an apostrophe inside of it and it seems to confuse cluetip plugin. Is there anyway to escape or encode an apostrophe to allow cluetip to work properly.

Answer

SLaks picture SLaks · May 23, 2011

You're looking for &apos;.
See HTML entities.