JQuery.remove () cancel?

Is there any way to achieve this? I use a pagination plugin that reads the number of li inside my ul and determines the number of numbered links to spit out.

+3
source share
4 answers

You probably want to use .hide () and check if it is visible or not.

This can be done using   $("li:visible")

+7
source

See jQuery docs:

$("#foo").remove().appendTo("#bar");

If it #foowas a child #bar, the above line has no effect. Now, storing $("#foo").remove()in a variable (this is a jQuery object) and re-adding it, you remain as an exercise; -)

Greetings

+5
source

, jQuery. , . ( ) .remove(), html - , .undo(), .

, , .hide()/. show() .toggle().

+1

remove(), append(). , , @contagious @Max Schmeling , toggle().

+1

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


All Articles