How to escape double quotes in a title attribute

I am trying to use a string that contains double quotes in the title attribute of an anchor. So far I tried these:

<a href="https://stackoverflow.com/questions/3752769/.." title="Some \"text\"">Some text</a>
<!-- The title looks like `Some \` --!>

and

<a href="https://stackoverflow.com/questions/3752769/.." title="Some &quot;text&quot;">Some text</a>
<!-- The title looks like `Some ` --!>

Please note that using single quotes is not an option.

7 Answers
7

Leave a Comment