lxwphp

1.通过ID或者其他元素找到要处理的HTML对象:(举例通过ID)

var obj=document.getElementById(\'id\');
1
2.操作此对象

添加属性:obj.setAttribute(\'attr_name\',\'attr_value\');
获取属性值:obj.getAttribute(\'attr_name\');
删除属性:obj.removeAttribute(\'attr_name\');

原文:https://blog.csdn.net/living_ren/article/details/79349402

分类:

技术点:

相关文章:

  • 2022-12-23
  • 2021-11-14
  • 2021-12-27
  • 2022-12-23
  • 2021-07-31
  • 2022-12-23
  • 2021-10-15
  • 2018-11-30
猜你喜欢
  • 2021-10-18
  • 2022-12-23
  • 2021-12-10
  • 2022-12-23
  • 2021-11-28
  • 2021-08-20
  • 2022-12-23
相关资源
相似解决方案