demo/load-event/custom.js
function htmlAsEntities(html){
    html = html.replace(/&/g, '&amp;');
    html = html.replace(/>/g, '&gt;');
    html = html.replace(/</g, '&lt;');
    html = html.replace(/"/g, '&quot;');
    html = html.replace(/'/g, '&#039;');
    return html;
}
function htmlAsEntities(html){
    html = html.replace(/&/g, '&amp;');
    html = html.replace(/>/g, '&gt;');
    html = html.replace(/</g, '&lt;');
    html = html.replace(/"/g, '&quot;');
    html = html.replace(/'/g, '&#039;');
    return html;
}
function htmlAsEntities ( html ) { html = html . replace ( / & / g , '&amp;' ) ; html = html . replace ( / > / g , '&gt;' ) ; html = html . replace ( / < / g , '&lt;' ) ; html = html . replace ( / " / g , '&quot;' ) ; html = html . replace ( / ' / g , '&#039;' ) ; return html ; }
Converts HTML markup to its
equivalent representation

@param  string
@return string
Converts HTML markup to its equivalent representation