Jump to content

I have been trying to get some sort of simple search that only searches for a given string within a single webpage and highlights it (and perhaps jumps to it). Looking for google I only fine ancient solutions relying on window.find (which isn't well supported anymore and doesn't seem to work) and some others that seem very hard to implement. 

 

So, It would be nice if someone could help me out.

 

If you want to reply back to me or someone else USE THE QUOTE BUTTON!                                                      
Pascal laptops guide

Link to comment
https://linustechtips.com/topic/593229-javascript-internal-and-local-search/
Share on other sites

Link to post
Share on other sites

You'd probably have to iterate over every text element (or any element that has text in it), compare it to the string you're looking for, then change the color (with CSS) or something to indicate matches

i7 4790k | MSI Z97S SLI Krait Edition | G.Skill Ripjaws X 16 GB | Samsung 850 EVO 500 GB | 2x Seagate Barracuda 2TB | MSI GTX 970 Twin Frozr V | Fractal Design R4 | EVGA 650W

A gaming PC for your budget: $800 - $1000 - $1500 - $1800 - $2600 - $9001

Remember to quote people if you want them to see your reply!

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×