Inspect hovered element in Chrome?

前端 未结 21 1551
小鲜肉
小鲜肉 2020-12-22 17:44

I am trying to view, through Chrome\'s developer tools, how tooltips are structured on a site. However, even when I am hovered over the item, when I \"inspect element\", not

21条回答
  •  死守一世寂寞
    2020-12-22 17:59

    Worth noting that toggling the :hover state from within the dev tools only has an impact if the hint text is enabled via CSS :hover rules in the first place. The toggle only applies the hover state to the element for rendering purposes, but does not trigger a corresponding JavaScript mouseover event.

    Many frameworks such as AngularJS dynamically attach tooltip HTML to the bottom of the document body via JavaScript when a target element is hovered, so any amount of hovering and inspecting the target element won't help.

    @joeyyang's answer worked very well for me in this scenario.

提交回复
热议问题