Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

164
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda