The character set is mentioned at Special Character Map. I need a Java-script or J-Query encoding code to get entity name.
for e.g. if I pass £ then I should get "£ ;" or for ¥ it should return "¥ ;".
Even I copy the symbols instead of typing in then also it should work.
I am trying to use following J-Query code but it doesn't seem to work when I copy-paste strings.
function krEncodeEntities() {
var s = $('#input').val();
return $('#lblEncode').text($("<div/>").text(s).html());
}
function krDencodeEntities() {
var s = $('#lblEncode').text();
return $('#lblDecode').text($("<div/>").html(s).text());
}
Can anyone please help me?