DOM元素的属性:
tagName:标签名
innerHTML:
innerText:
id:
title:
style:css样式
className:获得class属性特殊记
window.onlod=function(){}:
js中 等待页面的dom结点及图片视频加载完才调用
jQuery中页面的dom加载完就调用
getAttribute()获取元素中某个属性的值
getAttribute(“style”); 获取style值
setAttribute()设置元素中某个属性和值(需要接受两个参数:属性名和值,如果属性本身已存在,那么就会被覆盖。
)
setAttribute(“style”,“color:green;”);将颜色设置为绿色
removeAttribute()移除HTML属性
removeAttribute(“style”)