zoukankan      html  css  js  c++  java
  • document对象

    document

      找元素

        getElementById()根据ID找

        getElementsByClassName()根据class找,返回数组

        getElementsByName()根据name找,返回数组

        getElementsByTagName()根据标签名找,返回数组

      操作内容

        普通元素

          innerText获取内容文本

          innerHTML获取内容代码

        表单元素  value

      操作属性

        setAttribute(属性名,属性值)设置属性

        removeAttribute(属性名)移除属性

        getAttribute(属性名)获取属性

      操作样式

        a.style.width获取样式

  • 相关阅读:
    Linux network driver
    Linux dd
    Linux aclocal
    Ubuntu
    Makefile
    控制导出符号
    Apache
    Linux nm命令
    Git Submodule
    Linux sed
  • 原文地址:https://www.cnblogs.com/The-second/p/5896830.html
Copyright © 2011-2022 走看看