对网页进行的操作

<!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 οnclick="fn()">打开窗口</button>
            <button οnclick="clo()">关闭窗口</button>
            <button οnclick='move()'>moveBy</button>
            <button οnclick="to()">moveTo</button>
            <button οnclick="prin()">print</button>
            <button οnclick="scr()">scrollBy</button>
            <button οnclick='scr1()'>scrollTo</button>
        </p>
        
        <div style="height:2000px;width: 1500px;"></div>
        <!--onclick鼠标单击事件-->
        <script>
            var New;
            function fn(){
                New=window.open('3.html','','width=400,height=500');
            }
            function clo(){
                New.close();
            }
            function move(){
                New.moveBy(100,100);//相对当前位置进行移动
            }
            function to(){
                New.moveTo(100,100);//相对于电脑屏幕左上角
            }
            function prin(){
                window.print();//打印窗口
            }
            function scr(){
                window.scrollBy(50,50);//按固定的值进行滚动
            }
            function scr1(){
                window.scrollTo(0,0);//直接滚到指定位置
            }
            /*
             bom:浏览器模型
             window
             navigator
             Screen
             History
             Location
             存储
             * */
            alert();//弹出警示框,带确定按钮
            prompt();//弹出输入框,带提示,输入,确定,取消,返回输入的值
            var res=confirm('你的浏览器该升级了,点击确认升级');//弹出询问框,带确定,取消,返回true和false
            console.log(res);
        </script>
    </body>
</html>

转载于:https://www.cnblogs.com/GreenRadish/p/11134832.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值