java script 第二章

来源:互联网 发布:case when sql server 编辑:程序博客网 时间:2024/05/23 01:37
<!DOCTYPE html><html>  <head>    <title>shangji1.html</title> <script type="text/javascript" src="js/jquery-1.11.1.js"></script> <script  type="text/javascript"> day-02 javascript对象 1.history function fafa() {history.go(0);}function fa() {history.back();}function f() {history.foward();}2.location location.href location.reaload() location.replace() 3.documentwindow.onload=function(){var lis=document.getElementsByName("li");for(var i=0;i<i.length;i++){lis[i].style.cssText="background:pink";list[i].style.BackGroundColor="pink";list[i].style.FontSize="15xp";}1.使用window对象可以实现弹出窗口,关闭当前窗口,弹出页面消息框等效果。    2.使用date对象可以获得当前系统的日期,时间。    3.使用特定的函数与date()可以制作时钟特效。4.使用history和location对象的相关属性和方法可以轻松的实现浏览器中“后退”,前进“和”刷新“按钮的功能。    5.document对象的getElementById()方法用于访问唯一的元素。6.document对象的getElementByName()方法用于访问相同name属性的一组数组。7.document对象的getElementByTagName方法用于访问相同标签的一组数组元素。</script>  </head><body> <input type="button" onclick="fafa()" value="点击">  <input type="button" onclick="fa()" value="点击">  <input type="button" onclick="f()" value="点击">  <div>  <ui>  <li>香蕉</li>  <li>桃子</li>    </ui>  </div></body></html>

0 0
原创粉丝点击