If a page has many ul lists with various children, is there an easy way to only show the first five for each ul item, for instance? I know I can give each ul tag a unique id and then do like $("ul#id1 li").slice(5).hide(); for each one, or get all of them and then use a javascript loop to go over each particular one, but it seems like there should be an easier way. Thanks.
If a page has many ul lists with various children, is there an easy
Share
I’m pretty sure you will need a loop, since you are talking about addressing multiple ULs in one go:
Demo.