I am contemplating the advantages and disadvantages of adding elements to a page and setting display:none
versus creating a function that dynamically generates the elements and appends them where needed.
In my current situation, I am implementing a reply box that is attached to the desired comment for replies. Currently, I hide it using CSS and then relocate it to the desired node using an onclick
function. Is there a more optimal approach? I am relatively new to considering DOM rendering times, but I want to ensure I am following best practices moving forward.