Get all items that start with class name

后端 未结 5 1368
[愿得一人]
[愿得一人] 2020-12-17 00:30

I\'m trying to only show certain divs. The way I have decided to do this is to first hide all elements that start with \"page\" and then only show the correct <

5条回答
  •  长情又很酷
    2020-12-17 00:40

    You can use jQuery solution..

    var $divs = $('div[class^="page"]');
    

    This will get all the divs which start with classname page

提交回复
热议问题