IE event stream

<!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);
        Remove event: detachEvent (event, function);

        Tips: 
        IE in this === window in the anonymous function 
        DOM2 DOM0 level events with the same level event to add ON 
     -> 
</ head > 
< body > 
    < the Button the above mentioned id = "btn" > Click </ the Button > 
    < Script > 
        var BTN = document.getElementById ( " BTN " );
         function tan1 () { 
            Alert ( " popping box. 1 " ); 
        } 
        function tan2 () { 
            Alert ( " popping box 2 ')
        } 
        Btn.attachEvent ( " the onclick " , tan1); // pop-up 
        btn.attachEvent ( " the onclick " , tan2); // first pop 
    </ Script > 
</ body > 
</ HTML >

Guess you like

Origin www.cnblogs.com/vinson-blog/p/12112793.html