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

Popular posts from this blog

objective c - Change font of selected text in UITextView -

php - Accessing POST data in Facebook cavas app -

c# - Getting control value when switching a view as part of a multiview -