Hey all, I basically output content into a div like this using jquery:
var text = $("#edit").val();
$("#output").text(text);
But I want to turn "<" and ">" into "<" and ">".
text.replace(/</,"<");
doesn't seem to be working for me...
Any ideas? Many thanks
You could use something like the unescapeHTML()
function in prototype...
Adapted from prototype js source
function unescapeHTML(escapedHTML) {
return escapedHTML.replace(/</g,'<').replace(/>/g,'>').replace(/&/g,'&');
}
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