I have a webpage where people type stuff into a text box, and it displays that text below them. That's it. There is no server side.
Let's say someone types <script src="blah">hello</script>
I want to display that as text. Not as a script, of course. How can I do that (all in javascript)?
I want to display the entire text. Don't stip the tags out.
$('div.whatever').text($('input.whatever').val());
That'll convert things to HTML entities, so they're displayed as they were typed, and not treated as markup.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With