In this article, we will share with you the tutorial on hiding the content between divs by class name in js. We hope it can help you.
<html> <p class="aa">...</p> <p>bbbbb</p> <p>ccccc</p> <p>ddddd</p> <p class="aa">...</p> </html>
Copy after login
Requirement: Use js to loop through the contents of all p tags with class="aa" and not display them, only display this part:
<p>bbbbb</p> <p>ccccc</p> <p>ddddd</p>
Copy after login
It’s a very simple method, you can try it.
Related recommendations:
How to use CSS to hide divs in HTML