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

  • Home
  • SEARCH
  • 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 8046425
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T05:46:55+00:00 2026-06-05T05:46:55+00:00

I have a page with countless thousands of elements. Will the browser work more

  • 0

I have a page with countless thousands of elements. Will the browser work more efficiently (for example, getElementById) if I keep the number of elements with IDs to a minimum, or does it make no difference?

Thanks.

  • 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-06-05T05:46:58+00:00Added an answer on June 5, 2026 at 5:46 am

    Typically the DOM is loaded into a specialized tree-like data structure, and trees are designed for fast lookups. So once the page is in memory, all the searches will be blazing fast. The loading/parsing would be faster if you had a smaller file size, i.e. no IDs=less chars=less
    Bytes. But once it’s all loaded into memory, it shouldn’t matter much.

    It would also depend on the kind of algorithm that the browser’s JavaScript engine implements for the getElementById() method. I’m sure Chrome does it differently from IE or FF and vise versa. I wouldn’t worry about this part since you can’t control how each vendor implements their browser.

    The main point is, try and keep the file size smaller. Favor short node names and IDs over long ones because, after all, string matching is occurring at some step in the parsing/searching process.

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

Sidebar

Related Questions

I have Page A which calls Page B using AJAX. Page B will be
OK, first some background: I have a page showing the number of hits(or views)
Hello I have created XML which holds codes for properties and number of page
I have page which is redirected from htaccess. now I can pass the German
I have Page Tab App, which has a landing page with a Log In
I have page, i can contact directly without any problems. http://www.mysite.com/app_dev.php/comments/22 the page shows
I have a website that does not have page refreshes when the visitor navigates
What is the best method of doing the following: I have Page A with
I need something simple; I have page where a user clicks an author to
I have a page with some controls, usercontrols etc. when I change a div

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.