一、querySelectorAll
document.querySelectorAll('h1')//获取页面所有h1元素
document.querySelectorAll('h1.text.modal-title')//获取页面元素为h1属性为text.modal-title的所有元素
document.querySelectorAll('h1.text.modal-title')[0]//获取页面元素为h1属性为text.modal-title的第一个元素它的html具体内容
一、querySelectorAll
document.querySelectorAll('h1')//获取页面所有h1元素
document.querySelectorAll('h1.text.modal-title')//获取页面元素为h1属性为text.modal-title的所有元素
document.querySelectorAll('h1.text.modal-title')[0]//获取页面元素为h1属性为text.modal-title的第一个元素它的html具体内容