I was given such a task "The pop-up window itself before the call should not be located in the DOM-tree, but only loaded when the window is called and deleted when it is closed." Is it a web form component?

    2 answers 2

    Rather, you misunderstood the task correctly, the generated popup is not in the DOM, it should be in the js variable. When accessing the js event, you simply place the given code in a div, and the div is a DOM, but the task says it is about popup.

    In any case, somewhere you did not insert, you need to specify in js where to insert, and where to insert in any case is in the DOM. (be it a div, document, window, tag value, tag attribute, etc ...)

      You need to generate a pop-up on javascript, and then when referring to it, insert it into the dom.

      So before the pop-up call is in dom.

      • I understand, but the code must be inserted into an empty div, and an empty div will be initially in the house, that this should not be ... - NNN
      • @NNN createElement and appendChild , no? - Yaant
      • one
        @NNN An empty div may or may not be in the house. The body will be in any case?) $('body').append('<div id="popup">Window</div>'); - jekaby