I am needing to, on form submit, look at a certain textarea being submitted and check for all <code>
tags. Then take everything between a <code>
tag set and run this function on this function on it:
function escapeHtml(unsafe) {
return unsafe
.replace(/&/g, "&")
.replace(/</g, "<")
.replace(/>/g, ">")
.replace(/"/g, """)
.replace(/'/g, "'");
}
I was thinking of using :
$("code").each(function (){ });
Will that work? I'm testing it now but would like to know if there is a better way.