javascript - chrome中原生的$和$$是什么方法?

查看:117
本文介绍了javascript - chrome中原生的$和$$是什么方法?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

问 题

chrome中原生的$$$是什么方法?哪里可以查到文档?
$$返回的是Array
querySelectorAll返回的是NodeList
getElementsByXXX返回的是HTMLCollection

解决方案

这个快捷方法最开始是来自于Firebug
http://getfirebug.com/wiki/in...

然后chrome的文档在这儿
https://developers.google.com...


手动更新一下

$(selector) returns the reference to the first DOM element with the specified CSS selector. This function is an alias for the document.querySelector() function.

$$(selector) returns an array of elements that match the given CSS selector. This command is equivalent to calling document.querySelectorAll().

$x(path) returns an array of DOM elements that match the given XPath expression.

这篇关于javascript - chrome中原生的$和$$是什么方法?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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