Quantcast
Channel: Active questions tagged javascript - Stack Overflow
Viewing all articles
Browse latest Browse all 140676

How to check if $('.name') contains a specific value

$
0
0

I’d like to check if a specific value is in $('.name'). How can I achieve this? I can’t loop through $('.name'), because I already loop through an array to check if each entry is in $('.name'). It is possible that my array contains more object than $('.name'). Here is the code for better understanding:

let arr = ["a", "b", "c"];
let test = $('.name'); // <- contains multiple childs

for (let i = 0; i < arr; i++) {
    if (true) { // <- test contains arr[i]

    }
}

Viewing all articles
Browse latest Browse all 140676

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>