Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7030011
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T00:36:52+00:00 2026-05-28T00:36:52+00:00

When generating dynamic content, which way is better to simply create the HTML and

  • 0

When generating dynamic content, which way is better to simply create the HTML and insert it into a .innerHTML or to create elements in the DOM directly?

I’m not concerned with complexity or other. Just processing time on the client.

Which is quicker?

If I had to guess in order of efficiency (low processing time) this would be:

  1. DOM Creation
  2. .innerHTML property insertion
  3. direct writing

This would be inversely related to the complexity of implmenting:

  1. direct writing
  2. .innerHTML property insertion
  3. DOM Creation

This is a validatin question? Can someone validate that this is the trade-offs for determining how to update the client (i.e. javascript) when considering complexity and speed?

Research:

I’m not concerned with security like they are here->
InnerHTML vs. DOM – Security

InnerHTML vs. DOM
This is not a duplicate as it covers only part of my question.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T00:36:53+00:00Added an answer on May 28, 2026 at 12:36 am

    From my own personal tests they’re all fast enough for most needs. But if you’re doing something crazy like creating thousands of elements to a page the fastest way is to use document fragments. John Resig wrote a good blog post about it. http://ejohn.org/blog/dom-documentfragments/

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm automatically generating a PDF-file with Platypus that has dynamic content. This means that
I have a webpage with jquery generating dynamic html input boxes. Something like this
So I'm generating an html table through my php to arrange my content. Unfortunately,
I'm generating a dynamic assembly using Reflection.Emit which includes a single class. I have
I'm generating a coupon based on dynamic input and a cropped image, and I'm
Should a highly dynamic website that is constantly generating new pages use a sitemap
What is better to use for Exception output message dynamic generation String or StringBuilder
I am generating a dynamic fieldset with javascript. For adding fields, I use the
I am generating a dynamic sitemap.xml According to sitemaps.org this is the header for
I am generating dynamic PDF reports in PHP and having some issues with links

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.