JQuery: disconnect or not disconnect?

I read that itโ€™s good to separate elements before working with them , but I was interested

  • when does it cost? when not?

    for example, I have an HTML table with rows, I update one row by changing the cell values โ€‹โ€‹(5 cells or so) and adding a class to the row. Should I detach a row from the table and then attach it back?

  • how to deal with the fact that the element "disappears" for a while?

    If I understand well, detaching an element removes it from the DOM, and therefore it kind of โ€œdisappearsโ€ (I mean visually). Is there any way to prevent this? (Maybe something like making a copy of the element working on it, and then replacing 2?)

  • if I want to bind an element again where it was before, is there an elegant way to do this?

+5
source share

Source: https://habr.com/ru/post/1237749/


All Articles