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

119
Visualizações
What does this action do: document.querySelector('#element')['something'] = 'whatever'?

document.querySelector('#element')['something'] = 'whatever' What am I achieving by setting some sort of invisible attribute on the element? Is there any documentation on this?

I played around with it, confirmed that I can retrieve the value later and now I'm wondering is how useful it is and how reliable it is.

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

Yes, it can be done. But it's not advised. Remember that html and dom have many standards to adhere to and with changes such as these, you are testing the limits of user's browsers expectations.

This is more clearly explained in the answer to this question: Javascript DOM: Setting custom DOM element properties

about 4 years ago · Juan Pablo Isaza Relatório
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