Home > Web Front-end > JS Tutorial > body text

js hide content between divs by class name

小云云
Release: 2017-12-09 17:25:00
Original
2079 people have browsed it

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

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!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!