Find all elements with a certain attribute value in jquery

后端 未结 5 1093
旧时难觅i
旧时难觅i 2020-12-02 11:16

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..)

5条回答
  •  借酒劲吻你
    2020-12-02 11:39

    $('div[imageId="imageN"]').each(function() {
        // `this` is the div
    });
    

    To check for the sole existence of the attribute, no matter which value, you could use ths selector instead: $('div[imageId]')

提交回复
热议问题