zoukankan      html  css  js  c++  java
  • window的三种系统弹框介绍

    <!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>Document</title>
    </head>

    <body>
        <script>
            /* 001-弹出对话框,作用是提示用户 alert() */
            // alert(123);

            /* 002-弹出对话框,拥有取消和确定两个按钮,confirm()   */
            // var flag = confirm("确定要删除核按钮的密码吗?");
            /* 如果点击的是确定,返回true 取消那么返回的是false */
            // console.log(flag);

            /* 003 弹出输入框,标题 && 输入框 && 取消 && 确定*/
            // var res = prompt("请输入您的昵称?");
            var res = window.prompt("请输入您的昵称?", "小妖怪");
            /* 确定:输入框的内容 */
            /* 取消:null */
            console.log(res);
            /* 上面的这三个方法都是window的方法 */
            console.log(window.prompt == prompt, alert == window.alert); /* true trues */
        </script>
    </body>

    </html>
  • 相关阅读:
    [leetcode] Best Time to Buy and Sell Stock II
    [leetcode] Best Time to Buy and Sell Stock
    [leetcode] Binary Tree Maximum Path Sum
    [leetcode] Triangle
    [leetcode] Populating Next Right Pointers in Each Node II
    [leetcode] Pascal's Triangle II
    [leetcode] Pascal's Triangle
    第三周周总结
    基础DP
    第二周周总结
  • 原文地址:https://www.cnblogs.com/huayang1995/p/12077333.html
Copyright © 2011-2022 走看看