Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

236
Views
Al intentar configurar el contenido de un elemento HTML en un Emoji en javascript, muestra símbolos extraños

Quiero tener una función de javascript que cambie el texto de un elemento con la identificación "emoji" al emoji de risa.

 function changeEmoji() { document.getElementById("emoji").textContent = "🤣" }

pero cuando uso este código, el elemento muestra 🤣 en su lugar.

about 4 years ago · Santiago Trujillo
1 answers
Answer question

0

puede agregar emoji usando su identificación Unicode http://unicode.org/emoji/charts/full-emoji-list.html#1f600

para smiley laungting es el código 0x1F923

 var emoji = String.fromCodePoint(0x1F923)

Tenga cuidado, String.fromCodePoint() es parte del estándar ES2015, por lo que puede tener problemas en algunos navegadores antiguos

 var emoji = String.fromCodePoint(0x1F923) document.getElementById("emoji").textContent = emoji;
 <div id="emoji"> </div>

about 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!