`
William.K
  • 浏览: 5875 次
  • 性别: Icon_minigender_1
  • 来自: 济南
最近访客 更多访客>>
社区版块
存档分类
最新评论

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

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics