Here you can find the source of htmlDecode(value)
function htmlDecode(value) { if(value)//from ww w .jav a 2 s .com { return $("<div />").html(value).text(); } else { return ''; } }
String.prototype.htmlDecode = function() { return this.replace(/\&\;/g, '\&').replace(/\>\;/g, '\>').replace( /\<\;/g, '\<').replace(/\"\;/g, '\'').replace(/\&\#39\;/g, '\''); };
String.prototype.htmlDecode = function () { var div = document.createElement('div'); div.innerHTML = this; return div.innerText || div.textContent; };
String.prototype.decodeHtml = function () { var string = new String(this); string = string.replace(/</g, "<"); string = string.replace(/>/g, ">"); string = string.replace(/"/g, "\"") string = string.replace(/&39;/g, "'"); string = string.replace(/&/g, "&"); return string
String.prototype.decodeHtmlEntity = function(){ var ta = document.createElement('textarea'); ta.innerHTML = this; return ta.value; };