Possible Duplicates:
Check if text is in a string
JavaScript: string contains
I’m trying to check if a string I import into my application has a certain piece of text. I know how to do this with jQuery, but how do I do it with straight up JavaScript?
Here you go: ES5
With ES6 best way would be to use
includesfunction to test if the string contains the looking work.