Check if jQuery has deleted an item

I have a script that removes the h4 element and then animates the hidden form in its place. I am trying to check if the h4 element has been deleted, so if the same button is pressed and the form is visible, it will be animated.

Here is the first part of my code

$('#editMapItem h4').remove();
+3
source share
2 answers

check the length of the selector, for example:

$('#editMapItem h4').length

if it = 0, you have already deleted it.

+6
source

You can check the visibility of any element by adding Firebug in Firefox. Hope this helps.

0
source

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


All Articles