document.getElements() support

ε祈祈猫儿з 提交于 2019-12-01 19:16:31

There is no such thing as document.getElements... I'll bet your coding in Jsfiddle and don't realize that the mootools lib is included ;)

Have a look: http://jsfiddle.net/Zevan/pRKzy/

quirksmode.org is a pretty good resource for things like this (though not fully updated on IE9, as it's a moving target at the moment).

Note: they don't have an entry for document.getElements() specifically (are you sure you're getting this name right?), but in general it's a pretty complete reference, here's an example - check out .querySelectorAll() (which does what you describe...).

Probably you are looking for querySelecterAll function:

elementList = parentNode.querySelectorAll(selectors);

This is most handy and much usable function.

To check how your requested feature is supported among browsers you can use "Can I Use" site:

https://caniuse.com/#search=querySelectorAll

On this site you can check not only functions but HTML attributes and CSS capabilities too

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!