简体   繁体   English

Chrome开发工具中的选择元素不起作用?

[英]Select element in Chrome Dev Tools not working?

I'm using the Chrome DevTools console to try to select elements in this page: http://www.ncbi.nlm.nih.gov/pubmed/?term=The+DIAMOND+(DHA+Intake+And+Measurement+Of+Neural+Development)+Study%3A+a+double-masked%2C+randomized+controlled+clinical+trial+of+the+maturation+of+infant+visual+acuity+as+a+function+of+the+dietary+level+of+docosahexaenoic+acid 我正在使用Chrome DevTools控制台尝试选择此页面中的元素: http ://www.ncbi.nlm.nih.gov/pubmed/?term=The+DIAMOND+(DHA+Intake+And+Measurement+Of+ 神经+发展)+研究%3A + A +双盲%2C +的随机+受控+临床+试验+ + +婴儿+视觉+敏度的+成熟+ + AS +的+食物的+ A +功能+ +水平+ +二十二碳六酸+

But I'm finding that everything I try to select returns null. 但是我发现我尝试选择的所有内容都返回null。 For example, if I type $('body') into the console, it returns null: 例如,如果我在控制台中键入$('body') ,它将返回null:

在此处输入图片说明

Why is this happening? 为什么会这样呢? There is definitely a <body> tag in the page. 页面中肯定有一个<body>标记。

And the same $('body') query in the console on other sites returns an element. 在其他站点的控制台中,相同的$('body')查询返回一个元素。

this site overwrites $ funtion. 该站点将覆盖$功能。 use jQuery instead. 改用jQuery

jQuery('body'); //Object { 0: <body>, context: HTMLDocument → pubmed, selector: "body", length: 1 }

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如果不首先使用 Chrome 开发工具检查元素,则无法 select 谷歌 Chrome 控制台中的 DOM 元素 - Cannot select a DOM element in Google Chrome Console without inspecting the element first using Chrome Dev Tools 无法使用Chrome开发工具检查元素 - Unable to Inspect an Element using Chrome Dev Tools Chrome Dev Tools 控制台 - 以编程方式选择框架 - Chrome Dev Tools console - select frame programmatically Chrome 开发工具:如何查看 HTML 元素的附加事件侦听器 - Chrome dev tools: How to see attached event listeners for an HTML element 元素存在于Chrome开发工具中,但不存在于View Source中-这怎么可能? - Element present in Chrome Dev Tools but NOT in View Source - how is this possible? 像 JavaScript 中的 Chrome Dev Tools 一样突出显示 HTML 元素 - Highlight HTML element just like the Chrome Dev Tools in Javascript Chrome开发者工具-通过重新加载页面记住所选元素 - Chrome Dev Tools - Remembering the selected element through page reload Chrome开发工具:从bookmarklet / Snippet访问DOM元素$ 0指针 - Chrome dev tools: Accessing the DOM element $0 pointer from bookmarklet/Snippet 如何在使用 chrome 开发工具时保持元素显示在 HTML 中 - How to keep an element displayed in HTML while using chrome dev tools cmd cURL 的工作方式与 chrome 开发工具获取不同 - cmd cURL not working the same as chrome dev tools fetch
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM