zoukankan      html  css  js  c++  java
  • IE事件流

    <!DOCTYPE html>
    <html lang="en">
    <head>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <meta http-equiv="X-UA-Compatible" content="ie=edge">
        <title>IE事件流</title>
        <!-- 
            针对IE8及其以前的IE版本
            添加事件:attachEvent(event,function);
            移除事件:detachEvent(event,function);
    
            tips:
            IE中匿名函数内的this===window
            DOM2级事件跟DOM0级事件一样要加on
         -->
    </head>
    <body>
        <button id="btn">点击</button>
        <script>
            var btn=document.getElementById("btn");
            function tan1(){
                alert("弹框1");
            }
            function tan2(){
                alert("弹框2")
            }
            btn.attachEvent("onclick",tan1);//后弹出
            btn.attachEvent("onclick",tan2);//先弹出
        </script>
    </body>
    </html>
  • 相关阅读:
    STL与泛型编程-练习2-GeekBand
    HashSet
    JAVA集合
    分布式锁1 Java常用技术方案
    JAVA 锁
    JAVA多线程二
    JAVA多线程一
    Redis pipeline and list
    mongo 安装
    Intersection of Two Arrays
  • 原文地址:https://www.cnblogs.com/vinson-blog/p/12112793.html
Copyright © 2011-2022 走看看