Question (prompt message dialog box)

From , 5 Years ago, written in JavaScript, viewed 166 times.
URL https://pastebin.vip/view/b3967a0e
  1. prompt弹出消息对话框,通常用于询问一些需要与用户交互的信息。弹出消息对话框(包含一个确定按钮、取消按钮与一个文本输入框)。
  2.  
  3. 语法:
  4.  
  5. prompt(str1, str2);
  6. 参数说明:
  7.  
  8. str1: 要显示在消息对话框中的文本,不可修改
  9. str2:文本框中的内容,可以修改
  10. 返回值:
  11.  
  12. 1. 点击确定按钮,文本框中的内容将作为函数返回值
  13. 2. 点击取消按钮,将返回null
  14. 看看下面代码:
  15.  
  16. var myname=prompt("请输入你的姓名:");
  17. if(myname!=null)
  18.   {   alert("你好"+myname); }
  19. else
  20.   {  alert("你好 my friend.");  }
  21.  
  22.  
  23.  
  24.  
  25. :在用户点击对话框的按钮前,不能进行任何其它操作。

Reply to "Question (prompt message dialog box)"

Here you can reply to the paste above

captcha

https://burned.cc - Burn After Reading Website