jQuery vs document.querySelectorAll

后端 未结 12 1062
闹比i
闹比i 2020-11-28 01:28

I heard several times that jQuery\'s strongest asset is the way it queries and manipulates elements in the DOM: you can use CSS queries to create complex queries that would

12条回答
  •  北海茫月
    2020-11-28 01:46

    I think the true answer is that jQuery was developed long before querySelector/querySelectorAll became available in all major browsers.

    Initial release of jQuery was in 2006. In fact, even jQuery was not the first which implemented CSS selectors.

    IE was the last browser to implement querySelector/querySelectorAll. Its 8th version was released in 2009.

    So now, DOM elements selectors is not the strongest point of jQuery anymore. However, it still has a lot of goodies up its sleeve, like shortcuts to change element's css and html content, animations, events binding, ajax.

提交回复
热议问题