开发者

Show some elements from jquery collection of elements

开发者 https://www.devze.com 2023-02-25 21:41 出处:网络
¡Holla pros, I have this piece of code, which is partially working. Based 开发者_StackOverflow社区on some conditions I want to make visible some of the list elements. Currently only the alert works.

¡Holla pros,

I have this piece of code, which is partially working. Based 开发者_StackOverflow社区on some conditions I want to make visible some of the list elements. Currently only the alert works. I`m not sure what is the error.


You're using attr wrong; it's meant to change an attribute of some html element. I was able to get this working by just changing attr to css, which is the correct way to update css; link to working fiddle here. You could also consider using classes combined with toggle, which can make your code easier to manage.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号