0
点赞
收藏
分享

微信扫一扫

标签默认属性的操作 js 230211

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


取值

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

var href = a.getAttribute("href")


赋值

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

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


删除

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

a.removeAttribute("title")


举报

相关推荐

0 条评论