Home >Web Front-end >JS Tutorial >Performance comparison of Javascript createElement and innerHTML for adding page elements_javascript skills

Performance comparison of Javascript createElement and innerHTML for adding page elements_javascript skills

WBOY
WBOYOriginal
2016-05-16 18:46:231264browse

Recently I encountered an efficiency problem with js, which was about adding new elements to the page.
Suppose we have a page as follows:

Copy the code The code is as follows: