A
A
Artem Melnykov2019-02-22 11:10:24
JavaScript
Artem Melnykov, 2019-02-22 11:10:24

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

3 answer(s)
H
Henry Chinasky, 2019-02-22
@yarik_gui

1. ctrl + f
2. You write - 'How to search the page?'
3. Prooofit.

A
Andrey Okhotnikov, 2019-02-22
@tsepen

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)

S
Stalker_RED, 2019-05-04
@Stalker_RED

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 question

Ask a Question

731 491 924 answers to any question