多个按钮功能可使用 javascript 展开和隐藏 div 部分
希望每个人在这个有趣的日子(或像我一样令人沮丧的
Hope everyone is having fun on this fun (or frustrating ???? like me) coding day. So, I came across a problem and was hoping someone could help guide me to the right solution. I want to set it so that when I click on the “read more” button, it adds the “active” class and would expand the paragraphs.
I was able to do a loop function for multiple buttons on the page, but when I click on one, it affects all the buttons. I know this is a looping problem but I have not figured out a way to solve it.
What I’m trying to do is basically only have the button I click on add the class, without it working on all the buttons on the webpage. I intend to add more buttons to the page, so if anyone has a better solution or knows of a looping method (cause I’m pretty sure the looping I’m using is the wrong way), please help.
Please see the video for what I mean when I click on one button, both buttons get affected by it.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论