Javascript window 对象

1. 利用DOM模型查找html元素:

  HTML DOM 结构:

  HTML 

         HTML.head

            HTML.head.title

           HTML.body

                HTML.body.a.href

                HTML.body.h1

 

                 Document.getElement.ById(’myAhchor‘).innerHTML = "NEW CONTENT"; 改变 标签中间 的文本;

                 Document.getElement.ById(’myAhchor‘).href= "/index.html"; 改变 标签  链接属性

                 Document.myForm.txtCount.value //得到 文本框 的

               

                 Document.write();//add content

                 document.body.scrollTop // 页面已经下拉的距离。

 

2. 使用window对象open()方法制作各种广告

             window 对象包括document对象和history,location;

 

                  window.document 

              window.status//状态栏中的信息

              window.screen//客户端屏幕和现实性能的信息

              window.history//客户访问过的URL信息

 

             open("url",name);//打开具有指定名称的新窗口;

             close(); //关闭当前窗口;

             showModalDialog("register.html");

 

3. Date;setTimeout();

              var today = new Date();

              today.getHours();//return int;

                   today.getYear();//return int;

                   today.getDate();//return int;

                   today.getDay();//return int;   每周的第几天!

 

                   setTimeout(“function1()”,1000);

4. History

              history.back();//后退

                   history.forward();//前进

 5. DIV

               div1.style.display="none";//隐藏一层;

                              .visibility:

                                     .visible(默认)

                                     .hidden(不可见),设为hidden是元素看不见但是尺寸仍然在

                                .display:

                                     inline

                                     block

                                     none

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值