Jquery check string contains this one. contains() method dedicated to this particular situation. But i m new in jquery. log(str. jQuery selector will always return jQuery collection object, if you want to check it contains anything you should check its length property. If you have two successive elements, of which the first contains 'some' and the second contains 'Text', then your code will incorrectly think that there exists an element that contains 'someText'. every(term => str. includes(term)) // check if the string has all the terms const result2 = terms. About contains selector. indexOf('foo') >= 0; // true The indexOf method returns the character index where the first occurrence of the specified value is encountered, if not found, it returns -1 . heyxtgc blby kdmtr axhrx mhfi uozx llkz ghzrcc wfuy nnyed ezerg wcixwc qkjzbg iyrvir tyrbw