jquery if string contains code example
Example 1: if str contains jquery
if (str.indexOf("Yes") >= 0)
//case insensitive version
if (str.toLowerCase().indexOf("yes") >= 0)
Example 2: check for substring javascript
const string = "javascript";
const substring = "script";
console.log(string.includes(substring)); //true
Example 3: jquery contains text
$( "div:contains( 'hello' )" )
Example 4: javascript string contains
var string = "foo",
var substring = "oo";
console.log(string.includes(substring));