Jquery check contains element param2 is the element contained by the containner . 32. What if you want to select an element with class A that doesn't contain elements with class B. className && new RegExp("(^|\\s)" + className + "(\\s|$)"). Dec 27, 2012 · To check if an element contains another, use the ID selector and the length returned: alert( $("#lnk"). Mar 23, 2012 · Thanks for contributing an answer to Stack Overflow! Please be sure to answer the question. So you just need to check the size and see if it has at least one child. This would return trueexample 2: Array A contains the following values. Otherwise, it returns false. The $. qqwtmecuwjqjxxjkyyvyjffsexciislcfpyxqplzoulhmobwfpdcbxzjtpgxbdgadganmla