javascript - How would I sanitize this string? (perferably in JQuery)? -
i have webpage people type stuff text box, , displays text below them. that's it. there no server side.
let's types <script src="blah">hello</script>
i want display text. not script, of course. how can (all in javascript)?
i want display entire text. don't stip tags out.
$('div.whatever').text($('input.whatever').val());
that'll convert things html entities, they're displayed typed, , not treated markup.
Comments
Post a Comment