且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何在JQuery中选择具有特定属性值的元素

更新时间:2023-01-17 18:15:18

比如你可以接下来:

Hi , for example you can achive it by next:


(ul)。find([data-val =''+ MyVal+'']);
("ul").find("[data-val=''" + "MyVal" + "'']");





您也可以尝试覆盖这样的提示:





Also you can try to laverage such tip:


(this).nextAll(''div [data-val =''+ MyVal +''']'' )
(this).nextAll(''div[data-val="''+MyVal+''"]'')



其中div是包含在serach循环中的容器


where div is a container wich is included in serach loop