How can I inspect disappearing element in a browser?

前端 未结 10 1855
灰色年华
灰色年华 2020-12-04 05:43

How can I inspect an element which disappears when my mouse moves away? \"Example

10条回答
  •  忘掉有多难
    2020-12-04 06:36

    1. Open console
    2. Type in setTimeout(()=>{debugger;},5000);
    3. Press Enter

    Now you have 5 seconds to make your element appears. Once it appeared, wait until the debugger hits. As long as you don't resume, you can play with your element and it won't disappear.


    Useful tip to avoid repeating those steps above every time:

    add this as a bookmarklet:

    1. Bookmark any page
    2. Edit this new bookmark
    3. Replace the URL/location with: javascript:(function(){setTimeout(()=>{debugger;},5000);})();

    Next time you wish to use this, just click/tap this bookmark.

提交回复
热议问题