Operation of web pages

<!DOCTYPE html>
<html>
    <head>
        <meta charset="UTF-8">
        <title></title>
        <style>
            p{position:fixed;left:0;top:0;}
        </style>
    </head>
    <body>
        <p>
            <a href="http://www.baidu.com" target="_self" >跳转</a>
            <Button onclick = "fn ()"> Open Window </ button>
            <Button onclick = "clo ()"> Close </ button>
            <button onclick='move()'>moveBy</button>
            <button onclick="to()">moveTo</button>
            <button onclick="prin()">print</button>
            <button onclick="scr()">scrollBy</button>
            <button onclick='scr1()'>scrollTo</button>
        </p>
        
        <div style="height:2000px;width: 1500px;"></div>
        <-! Onclick mouse click event ->
        <script>
            New was;
            function fn(){
                New=window.open('3.html','','width=400,height=500');
            }
            function clo(){
                New.close();
            }
            function move(){
                New.moveBy (100,100); // move relative to the current position
            }
            function to(){
                New.moveTo (100,100); // relative to the upper left corner of the computer screen
            }
            function prin(){
                window.print (); // Print Window
            }
            function scr(){
                window.scrollBy (50,50); // fixed scroll value
            }
            function scr1(){
                window.scrollTo (0,0); // specified position directly rolled
            }
            /*
             bom: browser model
             window
             navigator
             Screen
             History
             Location
             storage
             * */
            alert (); // pop-up alert box with the OK button
            prompt (); // pop input box, with a prompt, enter, OK, Cancel, returns the input value
            var res = confirm ( 'This upgrade your browser, and click OK upgrade'); // pop up asking box with OK, Cancel, returns true and false
            console.log(res);
        </script>
    </body>
</html>

Guess you like

Origin www.cnblogs.com/GreenRadish/p/11134832.html