Inspect hovered element in Chrome?

前端 未结 21 1578
小鲜肉
小鲜肉 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 18:18

    You would just need to force the tooltip to show as such

    $('.myelement').tooltip('open');
    

    Now the tooltip will show regardless of hovering state.

    Scroll down near the bottom of the DOM where you should see the markup.

    Update see cneuro's comment for Bootstrap 3.

    $('.myelement').tooltip('show');
    

    Update see Marko Grešak's answer for Chrome and apparently Safari as well, $0 can be used as a shortcut for the currently selected element. This appears to work in Safari as well.

    $($0).tooltip('show')
    

提交回复
热议问题