Display: show() display:block;
Hide: hide() display:none;
When switching between display and hiding, you need to determine whether it is displayed or hidden at the moment. The following methods are commonly used to determine the conditions:
1.if(thisNode.is(':hidden')){......}else{.....}
2. First add a class identifier to the Dom element of thisNode, for example, change the identifier to class="showFlag", the judgment is as follows
if(thisNode.hasClass('showFlag')){.....}else{......}
In the same way, you can also judge other contents of thisNode, such as the number of sub-elements, text content, etc., based on specific needs.