|
@@ -10,11 +10,19 @@
|
|
<h1>world</h1>
|
|
<h1>world</h1>
|
|
<script>
|
|
<script>
|
|
var oH1 = document.getElementsByTagName("h1");
|
|
var oH1 = document.getElementsByTagName("h1");
|
|
|
|
+ // 鼠标点击事件(单击)
|
|
oH1[0].onclick = function(){
|
|
oH1[0].onclick = function(){
|
|
// console.log("hello world")
|
|
// console.log("hello world")
|
|
// oH1[0].innerText = "你好";
|
|
// oH1[0].innerText = "你好";
|
|
- this.innerText = "hello world"
|
|
|
|
|
|
+ this.innerText = "hello world";
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ var oBody = document.getElementsByTagName("body")[0];
|
|
|
|
+ oBody.oncontextmenu = function(){
|
|
|
|
+ console.log("hello");
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
|
|
+
|
|
</script>
|
|
</script>
|
|
</body>
|
|
</body>
|
|
</html>
|
|
</html>
|