Insert emoji into html input
I would like to know because when I enter the emoji code in an input in the html does not appear the emoji but the hexadecimal code, if I insert the code in any area in the html works less in the input field. I tried inserting into VALUE but without success. Would anyone know to inform me
<input type="text" id="send_msg" name="message" class="write_msg" value="😃" role="image" placeholder="Digite aqui sua mensagem" />
0
Author: Giovani Junior Sobrinho, 2019-09-21
1 answers
Use <meta charset="UTF-8">
so that there is consistency in the appearance of the emoji across platforms.
HTML
<input id='usrInput' value=''>
JavaScript
document.getElementsByTagName("INPUT")[0].value = String.fromCodePoint(0x1F354);
0
Author: Rafael Soares, 2019-09-21 06:03:25