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

168
Vistas
Should I use Javascript when dealing with many similar pieces of HTML code?

Right now I have a hard-ish to read HTML page composed of ~300 lines of code. Most of the code however comes from the same form repeated multiple times, with no changes whatsoever except for the id (which differs by a number). Would it be an acceptable or even encouraged practice to use Javascript to attach the same piece of HTML code to the DOM as many times as I need it? I'm a beginner to JS, so I don't have any clue about any performance impact that this could cause, and I can't see anything bad coming from this approach.

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

In my opinion, semantic HTML that is verbose and not rendered through JavaScript is the way to go. The only reason you wouldn't want to do this is if your application could scale and more forms would be rendered in the future. If there are a set amount of forms, debugging and handling data will be easiest by simply hardcoding all of the HTML.

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