【前端】js通过元素属性获取元素
<div for="hc_opportunity_config">aaaaa</div>
//通过属性获取元素
document.querySelector('[for="hc_opportunity_config"]')
document.querySelector('[属性="属性值"]')
我是Superman丶 博主文章分类:前端技术 ©著作权
【前端】js通过元素属性获取元素
<div for="hc_opportunity_config">aaaaa</div>
//通过属性获取元素
document.querySelector('[for="hc_opportunity_config"]')
document.querySelector('[属性="属性值"]')
js | javascript获取和设置元素的属性
1.用于处理xml文档的dom元素属性属性名 描述childNodes返回当前元素所有子元素的数组firstChild返回当前元素的第一个下级子元素
举报文章
请选择举报类型
补充说明
0/200
上传截图
格式支持JPEG/PNG/JPG,图片不超过1.9M