zoukankan      html  css  js  c++  java
  • dhtml小结

    一、对于<input name="username" id="username_id" class="gray">获得tag的几种方法:
    WebBrowser1.Document.getElementsByName("username")
    WebBrowser1.Document.getElementById("username_id")
    WebBrowser1.Document.getElementsByTagName("input")(0)
    WebBrowser1.Document.getElementsByTagName("input")("username")
    WebBrowser1.Document.getElementsByTagName("input")("username_id")
    WebBrowser1.Document.getElementsByClassName("gray")[0] //Firefox下使用
    WebBrowser1.Document.all(0)
    WebBrowser1.Document.all("username")
    WebBrowser1.Document.all("username_id")
    WebBrowser1.Document.all.item("username")
    WebBrowser1.Document.all.item("username_id")
    WebBrowser1.Document.all.tags("input")(0)
    对于部分tag可以通过自己的专有集合方式访问,例如<img name="img1">:
    WebBrowser1.Document.images(0)
    WebBrowser1.Document.images("img1")
    当然也可以使用如下方法:
    WebBrowser1.Document.tags("img")(0)

    二、获得所有tag的集合的方法:
    WebBrowser1.Document.all

    三、获得某一类tag的集合的方法:
    WebBrowser1.Document.all.tags("input")
    另外部分tag有自己独有的方法,例如:
    WebBrowser1.Document.links
    WebBrowser1.Document.frames
    WebBrowser1.Document.forms
    WebBrowser1.Document.images
    WebBrowser1.Document.scripts
    WebBrowser1.Document.all.tags("select").options
    对于表格也类似,不过行是table.rows,列则是table.rows(0).cells

    四、设置tag的某个属性值有以下两种方法:
    vtag.src="a.gif"//直接访问tag下标,此方法在非ie浏览器中可能不被支持
    vtag.setAttribute("src","a.gif")//标准函数方法,推荐使用

    五、获得tag的Value值,和上面类似也有两种方法:
    vtag.src
    vtag.getAttribute("src")

    更多资料请自己看手册:

    http://download.csdn.net/source/1660838

  • 相关阅读:
    windows安装kafka
    excel打开utf-8的csv乱码
    laravel 记录慢sql日志
    php ftp连接的坑
    公用辅助方法
    ubuntu重置网络配置
    php socket
    docker ftp配置多个用户
    php aes-ecb-128位加密
    redis集群 哨兵模式
  • 原文地址:https://www.cnblogs.com/sysdzw/p/1939374.html
Copyright © 2011-2022 走看看