Hello,
I have array of keywords. How can I find if any of these keywords present in textarea? Is there any plugin or function to do that?
Thank you
Hello,
I have array of keywords. How can I find if any of these keywords present in textarea? Is there any plugin or function to do that?
Thank you
var words = $('#text').val().split(/\b[\s,\.-:;]*/);
var keywords = ['keyword1', 'keyword2'];
var isKeywordPresent = $.grep(keywords, function(keyword, index) {
return $.inArray(keyword, words) > 0;
}).length > 0;