问题
I would like to get the currently highlighted element that the browser search is actively highlighting. Is this possible?
My use case is, I have a collapsible Table of Contents with font-size 0, and when they search something, if it is in the ToC, it would be listed as a result. But since its font-size is 0, it would not be visible, so I would like to expand that section of the ToC.
来源:https://stackoverflow.com/questions/23479237/get-selected-element-from-browser-search