RelativPerspektivR
Reactiflux4y ago
5 replies
RelativPerspektiv

BIOLOGY SCIENCE – 12-55 Aug 13

lets say i have a HTML element to be stored as a cache.
is it better to store the element in the DOM and using the
display: none
to hide it so the user cant see it and when needed change the display to block to make the element visible
or
get the content of the element like this
<div>
  <span>lol</span>
  content
</div>

and save it to a txt file and deleting the element so it longer stays in the DOM and when needed read that saved txt file and insert the element to the DOM
which method is better ? (in terms of performance and bugs / problems)
Was this page helpful?