Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

151
Visualizações
How Do I Clear My DOM where the emoji is placed to make way for the new set of Array coming to the DOM

working on an emoji app where users can put in an emoji in an input and add to the end of my current emoji sitting in the DOM .

Once my emoji has been pushed into the array of the hardcoded emoji's, the current emoji on display is meant to be cleared to make way for rendering the new arrays in being sent over.

This is where I am stocked.

Here is my code

let emojiIcons = document.getElementById("emoji-disp-cont")
let emoji = ["👨🏾‍💻", " 🐄", " 💽"]

function render() {
  for (let i = 0; i < emoji.length; i += 1) {
    emojiIcons.textContent += emoji[i]
  }
}
render()
let addfrbtn = document.getElementById("addfr-btn")
addfrbtn.addEventListener("click", function() {
  let inputbox = document.getElementById("input-box")
  if (inputbox.value) {
    emoji.push(inputbox.value)
    inputbox.value = ""
    emojiIcons.textContent = ""
    render()
    console.log(emoji)
  }
})
about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda