Best way to find DOM elements with css selectors

后端 未结 5 838
感情败类
感情败类 2020-11-29 06:19

What\'s the easiest way to find Dom elements with a css selector, without using a library?

function select( selector ) {
 return [ /* some magic here please          


        
5条回答
  •  情深已故
    2020-11-29 06:23

    Here is a nice snippet i've used some times. Its really small and neat. It has support for the all common css selectors.

    http://www.openjs.com/scripts/dom/css_selector/

提交回复
热议问题