Answer the question
In order to leave comments, you need to log in
How to check input for a word?
For example, when loading input, it already contains the word test and there are 2 divs.
<div id="teg1"></div>
<div id="teg2"></div>
Answer the question
In order to leave comments, you need to log in
Take a string from the input $(input).val() and check it using the indexOf(required string) method if the string is found the method will return the number of the beginning of the string if the string is not found it will return -1 here is an example of $(input).val().indexOf ('test') !== -1 - if true then the search string is in the input text
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question