I have added an emoji into html code having written its dec representation inside a div - " 😀 "; How do I get the numeral presentation of π? I need to process a string containing both - text and emojis and the emoji should be represented in numeral view. So , if I have a string containing - "hello world π" , it should be replaced to "hello world 😀 ;"
document.onreadystatechange = function(){
if(document.readyState == "complete"){
document.getElementById("area").addEventListener("keypress" , public_mode);
}
}
function public_mode(event){
var key = event.key;
if(key === "Enter") {
event.preventDefault();
sendMessage(this);
}
}
function sendMessage(area){
console.log(area.innerHTML);
area.innerHTML = "";
}
#area {
padding: 5px;
width: 170px;
border:1px solid black;
}
<div id = "area" contenteditable="true">How to get it in dec - 😀</div>