Is it possible to convert html tags to html entities using javascript/jquery using any way possible such as regex or some other way. If yes, then how?
Exampl
Try this function for the HTML special characters:
function htmlencode(str) { return str.replace(/[&<>"']/g, function($0) { return "&" + {"&":"amp", "<":"lt", ">":"gt", '"':"quot", "'":"#39"}[$0] + ";"; }); }