Get selected element from browser search

拥有回忆 提交于 2019-12-25 03:01:11

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!