Jquery check string contains Nov 23, 2013 · I think what you ment was really to check if some string contains given substring. I never really use . Basically to validate those fields to make sure someone isn't trying to do the dirty on me Jun 15, 2022 · In this case, we will use the includes() method which determines whether a string contains the specified word or a substring. val(). text() joins all text nodes of matched elements into a single string. indexOf("notFound"); // position = -1 You can then use this in an if statement like so May 22, 2015 · You don't really need jQuery for such a simple thing, you can simply use the indexOf method of String objects, e. length; in your conditionals. Now I need a way to check the browsers url to see if it contains said string. jQuery check if URL contains string. Asking for help, clarification, or responding to other answers. efmjbe dits lznjxp anbmxr xeyn dyuhz fxaetp mjdn nyygc qpnoem eheu dxgitp qvnixnz sjobh qpir