Skip to content Skip to sidebar Skip to footer

Storing HTML Within Attribute

I'm storing HTML code within an element attribute like so.
) .replace(/"/g, '&quot;') .replace(/'/g, '&#39;') .replace(/</g, '&lt;') .replace(/>/g, '&gt;'); }

this should give you a string that can be used as a valid html attribute value


Post a Comment for "Storing HTML Within Attribute"