一、setAttribute()
setAttribute()方法添加指定的属性,并为其赋指定的值,如果这个指定的属性已存在,则仅设置或更改值。不能通过document对象调用。
语法:element.setAttribute(attributenname,attributevalue)
二、getAttribute()
getAttribute()方法返回指定属性名的属性值。不能通过document对象调用。
语法:element.getAttribute(attributenname)
三、removeAttribute()
removeAttribute()方法移除节点指定名称的属性。不能通过document对象调用。