zoukankan      html  css  js  c++  java
  • js中document的用法小结


    document常用属性:

      document.title//设置文档标题,与HTNL中的title标签等价

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

      document.fgColor//设置页面前景色

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

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

      document.URL//可返回当前文档的URL

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

      doucment.alinkColor//鼠标在此链接上的颜色

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

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

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

      document.cookies//设置和读出cookie

    document的常用方法:

      document.createElement(Tag)//创建HTML元素

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

      document.getElementByName(name)//获得name值的对象

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

      document.body.appendChild(oTag)//向节点添加最后一个子节点

    body主体子对象:

      document.body//指定文档主体的开始和结束,等价于body>/body>

      document.body.bgColor//设置或获取对象的背景颜色

      document.body.link//未点击过的连接颜色

      document.body.alink//鼠标在链接上时的颜色

      document.body.vlink//点击过的链接颜色

      document.body.text//文本颜色

      document.body.topMargin//页面上边距

      document.body.leftMargin //页面左边距
      
      document.body.rightMargin //页面右边距
      
      document.body.bottomMargin //页面下边距

      documenr.body.background//背景图片

      document.body.appendChild(oTag)//动态生成一个Html对象

    常用对象事件:

      document.body.onclick=”func()” //鼠标指针单击对象是触发
      
       document.body.onmouseover=”func()” //鼠标指针移到对象时触发
      document.body.onmouseout=”func()” //鼠标指针移出对象时触发

  • 相关阅读:
    easyUI 后台经典框架DEMO下载
    一个通过JSONP跨域调用WCF REST服务的例子(以jQuery为例)
    WCF的三个名称/命名空间,你是否傻傻分不清楚?
    未找到与约束ContractName Microsoft.VisualStudio.Text.ITextDocumentFactoryService... 匹配的导出 VS2012报错
    jquery easyui tabs单击刷新右键刷新
    在64位Windows7上安装64位Oracle11g
    Linux入门
    服务器硬件知识
    IP后面带/30 /29 /27等是什么意思?
    vitualbox安装centos7卡死
  • 原文地址:https://www.cnblogs.com/kuangkuangduangduang/p/10543110.html
Copyright © 2011-2022 走看看