Answer the question
In order to leave comments, you need to log in
How to do a page search?
Can you help me to make the text compare with the text on the page and if the text is found it will be highlighted in yellow? <input>
Answer the question
In order to leave comments, you need to log in
1. ctrl + f
2. You write - 'How to search the page?'
3. Prooofit.
You iterate through all the elements on the page, compare the text of each with the input value, if it matches, wrap this text in a span with the desired class (for highlighting)
You connect mark.js
On the input you hang a handler that listens to input, change and paste
You send the value of this input to mark.js
Profit!
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question