(1)通过id属性:document.getElementById()
(2)通过class属性:document.getElementByClassName()
(3)通过标签名:document.getElementByTagName()
(1)$("#id")
(2)$(".class名")
(3)$("标签名")
这样的写法就显得简洁明了得多了
jQuery封装JavaScript定位DOM对象的三种方式
原文:https://www.cnblogs.com/happy-lin/p/15118101.html