DOM elements dynamic or reflection of existing ones?



  • There are nine menus on the website that need to be pressed on the relevant buttons. How is it better to do this through a dynamic js machine, or to paint it in html, throw it in a "display: none" and, if necessary, change the display parameter? And will the site be downloaded into "dispay: none"?



  • If these elements and their content are static, I'd suggest that one component be created (and that one component be reused) and that it be shown conditionally. The content can also be generated by one function if it is the same menu with different content. The full generosity through the JS will last longer, and it will not be justified, so this is a way for very special case files. Elements display: none Still in DOM, but they won't, so the impact on productivity in our case will be negligible.



Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2