如何在浏览器中检查消失的元素? [英] How can I inspect disappearing element in a browser?

查看:371
本文介绍了如何在浏览器中检查消失的元素?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何检查鼠标移开时消失的元素?

我不知道它的ID,类或任何东西,但想要检查它。

I don't know it's ID, class or anything but want to inspect it.

我尝试过的解决方案:

在控制台内运行jQuery选择器 $('*:contains( some text)')但是没有任何运气,主要是因为该元素未被隐藏但可能已从DOM树中删除。

Run jQuery selector inside console $('*:contains("some text")') but didn't have any luck mainly because the element is not hidden but probably removed from the DOM tree.

手动检查DOM树的更改不会给我任何东西,因为它似乎太快而无法注意到已发生的变化。

Manually inspecting DOM tree for changes gives me nothing as it seems to be just too fast to notice what have changed.

成功:

我在事件断点方面取得了成功。具体来说 - 在我的情况下是mousedown。只需转到来源 - >事件监听器断点 - >小鼠 - > Chrome中的mousedown 。之后我点击了我要检查的元素,在范围变量里面,我看到了一些有用的指示。

I have been successful with Event breakpoints. Specifically - mousedown in my case. Just go to Sources-> Event Listener Breakpoints-> Mouse-> mousedown in Chrome. After that I clicked the element I wanted to inspect and inside Scope Variables I saw some useful directions.

推荐答案

(此答案仅适用于Chrome开发者工具。)

(This answer only applies to Chrome Developer Tools.)

查找包含消失元素的元素。右键单击元素并应用Break on ...> Subtree Modifications。这将在元素消失之前抛出调试器暂停,这将允许您在暂停状态下与元素进行交互。

Find an element that contains the disappearing element. Right click on the element and apply "Break on... > Subtree Modifications." This will throw a debugger pause before the element disappears, which will allow you to interact with the element in a paused state.

这篇关于如何在浏览器中检查消失的元素?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆