Home  >  Article  >  Web Front-end  >  js hide content between divs by class name

js hide content between divs by class name

小云云
小云云Original
2017-12-09 17:25:002023browse

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>


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>

It’s a very simple method, you can try it.

Related recommendations:

How to use CSS to hide divs in HTML

How to hide content that overflows the DIV border

jQuery method to hide div

The above is the detailed content of js hide content between divs by class name. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn