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

251
Visualizações
Failed to execute 'createElement' on 'Document': The tag name provided () is is not a valid name

I am trying to spawn the DOM with some snowflakes.. I am getting this error in my console and no snowflakes.

Uncaught DOMException: Failed to execute 'createElement' on 'Document': The tag name provided ('< span id='flake0' style='cursor: default; -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; -o-user-select: none; user-select: none;position:absolute;top:-24'>• </ span>') is not a valid name.

I am not really sure what I am doing wrong here.. PHPStorm is also not giving me any hints. I am looping through all my snowflakes and they get random sizes.

Here is my code:

var container = document.getElementById("js-container");

for (let i = 0; i <= snowMax; i++) {
    var content = document.createElement("<span id='flake" + i + "' style='" + snowStyles + "position:absolute;top:-" + snowMaxSize + "'>" + snowEntity + "</span>");
    container.appendChild(content);
}

I also tried escaping the span with backticks, but it's not helping..

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