javascript - Convert special chars to HTML -


$scope.html = '<script>'; 

i know php has ability convert &lt;script&gt; <script> can javascript same?

using works

function escapespecialchars(text) {     return text         .replace(/&amp;/g, "&")         .replace(/&lt;/g, "<")         .replace(/&gt;/g, ">")         .replace(/&quot;/g, "\"")         .replace(/&#039;/g, "'"); } 

Comments

Popular posts from this blog

javascript - Jquery show_hide, what to add in order to make the page scroll to the bottom of the hidden field once button is clicked -

python - Django-cities exits with "killed" -

python - How to get a widget position inside it's layout in Kivy? -