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

166
Visualizações
Style is not defined in Javascript

enter image description here

enter image description here

how document.getelementbyclassname("but") I'm not able to modify the style inside the function. when i try to run the code i get this error enter image description here

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

0

When you use getElementsByClassName you are getting an array of elements. To fix your error, make sure to select the element you need, e.g.:

inputstxt[0].style.border = ..

Or if you want to apply the new styles to all:

for(let i = 0; i < inputstxt.length; i++) {
   inputstxt[i].style.border = ..
}
about 4 years ago · Juan Pablo Isaza Relatório

0

cannot set properties of undefined means that you are trying to read the style of an Array instead of an element. So you would need to document.getElementsByClassName("but")[i].style //i is any index to get/set the style.

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