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.

Leave a Reply

Your email address will not be published. Required fields are marked *

Serverless 360