zoukankan      html  css  js  c++  java
  • js_提示是否删除小案例

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <title></title>
    <script type="text/javascript">
    // window.alert('你好吗?');
    // alert('aaaa');
    // var n;
    // n = 10;
    // window.n = 11;
    // alert();
    // window.alert();

    //--------------------------------------------------------------------
    window.onload = function () {
    document.getElementById('btn1').onclick = function () {
    if (confirm('您确认要删除吗?')) {
    alert('删除成功!');
    } else {
    alert('取消删除!');
    }
    };
    document.getElementById('btn2').onclick = function () {
    // window.navigate('http://www.baidu.com');
    // window.location.href = 'http://www.baidu.com';
    //location.href = 'http://www.baidu.com';
    location = 'http://www.baidu.com';
    };
    };
    //---------------------------------------------------------

    </script>
    </head>
    <body>
    <input type="button" name="name" value="删除" id="btn1" />
    <input type="button" name="name" value="去百度" id="btn2" />
    </body>
    </html>

  • 相关阅读:
    正交相机下实现滚轮按钮拖动,滚动滚轮缩放的功能
    C#标记 [已弃用] 的方法
    JDBC-Mybatis-Hibernate
    Data Structures and Algorithm Analysis in Java
    Maven
    Java面试
    Bootstrap
    CSS3
    HTML5
    JSON
  • 原文地址:https://www.cnblogs.com/wangjinya/p/10239937.html
Copyright © 2011-2022 走看看