在 HTML 页面中查找元素时遇到问题

发布于 2024-10-25 09:55:12 字数 298 浏览 4 评论 0原文

自 90 年代以来就没有认真研究过 JavaScript,所以看起来有些事情发生了变化。我正在尝试调试一个页面(我没有写它)。因此,在 Chrome 中,我右键单击一个元素并选择“检查元素”。它让我想到一个看起来像这样的元素:

<div class="divRte" style="height:100px; width:200px">...</div>

我认为很简单。然后打开页面源代码(在浏览器中),并且没有任何地方提到 divRte 。

我在哪里可以找到它?它在哪里?

Haven't done serious JavaScript since 90s, so looks like a couple of things changed. I am trying to debug a page (i didn't write it). So in Chrome, I right-click on an element and select Inspect Element. It brings me to an element that looks like this:

<div class="divRte" style="height:100px; width:200px">...</div>

Easy enough, I think. Then open up the page source (in browser) and there is no mention of divRte anywhere.

Where can I find it? Where is it?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

风启觞 2024-11-01 09:55:12

您在“查看源代码”中看到的代码是浏览器从服务器获取的 html。但是,这并不是浏览器看到的源。当您使用 JS 更改 DOM 结构时,它们不会出现在视图源中。这就是您使用 firebug 的原因,它显示浏览器当时看到的确切 DOM 结构。

The code you see in "View source" is the html that browser got from the server. BUT, that is not the source as the browser SEES it. When you make changes in DOM structure with JS, they don't appear in the view source. That's why you use firebug, which shows the exact DOM structure that browser sees at that moment.

时光是把杀猪刀 2024-11-01 09:55:12

显然是添加了 javascript。所以你不会在源文档中看到它

It was obviously added there is the javascript. so you wont see it in the source doc

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文