I am creating an application where when a tab is clicked its content is loaded via ajax. The reason for this is to speed up the initial page load, and not to load unnecessary tab content. The tabs contain form items, where values can be changed. 

To prevent the data from being lost, When a tab is loaded I am giving it an extra class of "ajaxed". When the tabs are clicked if the class "ajaxed" does not exist, then the content is loaded via ajax, otherwise the content previously loaded is simply presented to the user.

Quesiton:
Does caching lots of HTML in the dom slow down performance?
Is this bad practice? This applies to infinite scroll and other types of pages where you simply keep appending more and more html. What are the drawbacks of this approach?

Thanks in advance.