I’m creating a page search function and I need to compare the contents of one variable to see if it exists in another variable in an if statement.
To make it simple here’s an expample:
var name = 'james';
var place = 'james lives in europe';
if (place:contains(james)) {
....... do something
}
Anyone know how to do this with jquery. cheers
1 Answer