标签默认属性的操作 js 230211

阅读 78

2023-02-11

支持系统属性与默认属性的


取值

示例:获取a标签对象的href属性的值

var href = a.getAttribute("href")


赋值

示例:给a标签对象的href属性赋值

a.setAttribute("href", "https://zhidao.baidu.com/")


删除

示例:删除a标签对象的title属性

a.removeAttribute("title")


精彩评论(0)

0 0 举报