Site icon Sibeesh Passion

Find a string contains a particular string in JQuery

[js]
var myVar="sibeesh passion");
if (myVar.toString().indexOf(‘passion’) > 0) {

}
else {
}
[/js]
The above code helps you to find whether a string contains a particular string or not in JQuery.

Exit mobile version