在 HTML 页面中查找元素时遇到问题
自 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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您在“查看源代码”中看到的代码是浏览器从服务器获取的 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.
显然是添加了 javascript。所以你不会在源文档中看到它
It was obviously added there is the javascript. so you wont see it in the source doc