zoukankan      html  css  js  c++  java
  • Document-对象属性和常用的对象方法

    Document-对象属性和常用的对象方法

    对象属性

    document.title                                  //设置文档标题等价于HTML的title标签

    document.bgColor                                //设置页面背景色

    document.fgColor                                //设置前景色(文本颜色)

    document.linkColor                                //未点击过的链接颜色

    document.alinkColor                                //激活链接(焦点在此链接上)的颜色

    document.vlinkColor                                //已点击过的链接颜色

    document.URL                                   //设置URL属性从而在同一窗口打开另一网页

    document.fileCreatedDate                            //文件建立日期,只读属性

    document.fileModifiedDate                           //文件修改日期,只读属性

    document.fileSize                                //文件大小,只读属性

    document.cookie                                 //设置和读出cookie

    document.charset                               //设置字符集 简体中文:gb2312

    ———————————————————————

    常用对象方法

    document.write()                                               //动态向页面写入内容

    document.createElement(Tag)                                         //创建一个html标签对象

    document.getElementById(ID)                                        //获得指定ID值的对象

    document.getElementsByName(Name)                                      //获得指定Name值的对象

    document.getElementsByClassName(“className”)                      //获得指定class值的对象(数组)

    document.getElementsByTagName(“TagName”)                         //获得指定Tag对象

    document.body.appendChild(oTag)

    ———————————————————————

  • 相关阅读:
    重新温习软件设计之路(4)
    重新温习软件设计之路(3)
    技术判断力
    GIS基本函数类库Delphi代码
    C#文本转语音并保存wav和MP3文件
    多网卡多网关浏览器访问外网
    自信与乐观
    System.Security.SecurityException when writing to Event Log
    4010 An unhandled security exception has occurred. IIS 8.5
    How to make a grid (like graph paper grid) with just css?
  • 原文地址:https://www.cnblogs.com/kingchan/p/6012808.html
Copyright © 2011-2022 走看看