HTML encoding in the browser


If you have jQuery:

function htmlEncode(value){
    return $("<div>").text(value).html();
}

Date: 2020-08-16

Tags:  javascript

Share: