Highlight searchresults and close button | Sololearn: Learn to code for FREE!


Highlight searchresults and close button

https://code.sololearn.com/WSrEXLmHXLOZ/?ref=app Need help to make highlighted match from search. Preferrably background color change. The code til now opens every parent detail element that has a text match within it. Background color shpuld change back when new search has been done. I also need a "close" button for the opened details.

3/19/2021 12:43:12 PM

Adrian Kydland Skaftun

1 Answer

New Answer


use filter on keydown to get the search result. addEventListener(onkeydown) on input tag and filter the results based on the input