JavaScript—HTML—DOM操作注意事项

jQuery对象是数组对象

1.如何使用使用 HTML DOM 来分配事件

错误的写法:

下面是正确的HTML DOM来分配事件(通常将js文件通过外部引入的方式)

原例网址:http://www.bubuko.com/infodetail_69609.html


点击按钮就可以执行 displayDate() 函数。

    //声明控件

2.js如何在指定页面跳转到另一指定页面

第一种:(跳转到b.html)



window.location.href="b.html";



第二种:(返回上一页面)



window.history.back(-1);



第三种:



window.navigate("b.html");



第四种:



self.location=’b.html’;



第五种:



top.location=’b.html’;

 

你可能感兴趣的:(JavaScript—HTML—DOM操作注意事项)