Manipulating Elements | jQuery Learning Center
Sat May 29 2021 01:51:47 GMT+0000 (Coordinated Universal Time)
Saved by @ejiwen
The syntax for adding new elements to the page is easy, so it's tempting to forget that there's a huge performance cost for adding to the DOM repeatedly. If you're adding many elements to the same container, you'll want to concatenate all the HTML into a single string, and then append that string to the container instead of appending the elements one at a time. Use an array to gather all the pieces together, then join them into a single string for appending:
https://learn.jquery.com/using-jquery-core/manipulating-elements/
Comments