Text to emoji #funny//🤣 #love 😗//100+,word to convert

 <!DOCTYPE html>

<html>

<head>

<title>Text to funny Emoji Converter</title>


<style>


body{


font-family: Arial;


text-align:center;


margin-top:50px;


}


textarea{


width:80%;


height:100px;


padding:10px;


font-size:16px;


}


button{


padding:10px 20px;


font-size:16px;


rgin-top:10px;


cursor:pointer; 

}

#output{

margin-top:20px;

font-size:20px;

}

</style>

</head>


<body>


<h1>Text to Emoji Converter</h1>


<textarea id="text" placeholder="Type your text here..."></textarea>

<br>


<button onclick="convertEmoji()">Convert</button>


<div id="output"></div>


<script>

function convertEmoji(){


let text=document.getElementById("text").value;


let emojiMap={

"love":"❤️",

"happy":"😊",

"sad":"😢",

"fire":"🔥",

"ok":"👌",

"cool":"😎",

"hi":"👋",

"bye":"👋",

"food":"🍔",

"star":"⭐"

“smile”:“😁”‚

};


let words=text.toLowerCase().split(" ");

let result="";


for(let i=0;i<words.length;i++){

if(emojiMap[words[i]]){

result+=emojiMap[words[i]]+" ";

}else{

result+=words[i]+" ";

}

}


document.getElementById("output").innerHTML=result;


}

</script>


</body>

</html>

Comments

Popular Posts