Efficiency of document. getelementbyid in Dom

Source: Internet
Author: User
Recently, we found that the document. getelementbyid method is used to obtain the validity rate of many TD objects.
It will be very low. I counted the time. Taking 1000 Td as an example, if we use document. getelementbyid to traverse and update the content in TD, it will take 2 seconds left.
Right, if you directly use the rows and cells attributes in the Dom to traverse data, the efficiency will be improved by at least five times. It seems that the HTML interface processing is really time consuming. Try not to use
Document. getelementbyid: traverses the original table with a large number of cells. ArticleIf you reprint it, please note: reposted from your blog
[Http://www.ajaxstu.com/
] This article link: http://www.ajaxstu.com/archives/document.getElementById.html

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.