Find elements using part of ID

前端 未结 6 1543
予麋鹿
予麋鹿 2021-01-05 05:54

I have, the div\'s where id looks like this_div_id_NUMBER, all div\'s has the different NUMBER part. How I find all

6条回答
  •  旧巷少年郎
    2021-01-05 06:42

    It is better to use classes. But there is one solution that you need (assuming you use jQuery):

    $("*[id^='this_div_id']")
    

提交回复
热议问题