string contains in Jquery
Like this:
Note that this is case-sensitive.
If you want a case-insensitive search, you can write
- <code>
- if (str.indexOf("Yes") >= 0)
- </code>
- <code>
- if (str.toLowerCase().indexOf("yes") >= 0)
- Or,
- if (/yes/i.test(str))
- </code>