Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

172
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!