Escape Quotes In HTML5 Data Attribute Using Javascript
I'm using jQuery's .data() to work with custom HTML5 data attributes where the value of the attribute needs to be able to contain both single quotes and double quotes: <p class="example" data-example="She said "WTF" on last night's show."> I know using character codes like " in the data attribute value could make the above work, but I can't always control how the values are inputted. Plus, I need to be able to use HTML tags in the markup, like this: <p class="example" data-example=" She said "<abbr title="What The F***">WTF</abbr>" on last night's show. "> If some form of .replace() is the