I need to find all elements that has a special attribute value.
Here is the div I need to find (I have many of them..)
<div imageId='imageN'>...
我只需要循环浏览有imageId='imageN'
个
I need to find all elements that has a special attribute value.
Here is the div I need to find (I have many of them..)
<div imageId='imageN'>...
我只需要循环浏览有imageId='imageN'
个
$('div[imageId="imageN"]').each(function() {
// `this` is the div
});
要判断属性是否唯一存在,不管是哪个值,都可以改用 Select 器:$('div[imageId]')