There is a popup that is enclosed in the <script> as a template, by clicking on the open button, I will use the jsrender library jsrender render this temlate, as well as by closing the button, I will delete it from the DOM , so that each pop-up initializes the new popup. whether the operation is expensive every time to remove it from the house model? Or simply make a popup and initially assign it display none , when clicked, it is natural to show it and then close and squeeze all the input values ​​when closing, that is, you do not need to initialize a new popup each time.

    1 answer 1

    Of course, it's better to just hide. But provided that the functional unit is not important. That is, do not forget that the hidden block is still present on the page, and data from it can be obtained.

    • Thanks and I will do - quaresma89