Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

lat4732's avatar
Level 12

How do I highlight the matched letter/word from a search query inside a text

Hey, @everyone!

How do I highlight the matched letter/word inside a text when I run a search query?

Here is an example.

How can I do this? Is this some kind of jQuery or what? Maybe I can get the value from the search input and look through the DOM for a word or letter inside a specific div. Is that a option?

0 likes
2 replies

Please or to participate in this conversation.