三种JavaScript 消息框
prompt 提示框
<html>
<head>
<script type="text/javascript">
function disp_prompt()
{
var name=prompt("请输入您的名字","Bill Gates")
if (name!=null && name!="")
{
document.write("你好!" + name + " 今天过得怎么样?")
}
}
</script>
</head>
<body>
<input type="button" onclick="disp_prompt()" value="显示提示框" />
</body>
</html>
confirm 确认框
<html>
<head>
<script type="text/javascript">
function show_confirm()
{
var r=confirm("Press a button!");
if (r==true)
{
alert("You pressed OK!");
}
else
{
alert("You pressed Cancel!");
}
}
</script>
</head>
<body>
<input type="button" onclick="show_confirm()" value="Show a confirm box" />
</body>
</html>
alert("我是警告框!!")
<html>
<head>
<script type="text/javascript">
function disp_alert()
{
alert 我是警告框!!
}
</script>
</head>
<body>
<input type="button" onclick="disp_alert()" value="显示警告框" />
</body>
</html>
三种JavaScript 消息框的更多相关文章
- JavaScript中的三种弹出框的区别与使用
JavaScript中有三种原生的弹出框,分别是alert.confirm.prompt.分别表示弹出框.确认框.信息框. 以下是示例代码: <!DOCTYPE html> <htm ...
- 关于jsp和html页面中的三种弹出框
代码: <!-- 引入jquery 由于在下面使用jquery选择器,与弹出框无关 --> <script type="text/javascript" src= ...
- js值类型转换(boolean/String/number),js运算符,if条件,循环结构,函数,三种弹出框
js值类型转换 number | string | boolean boolean类型转换 num = 0; var b1 = Boolean(num); console.log(b1) 转化为数字类 ...
- js基础 三种弹出框 数据类型
总结:js三个组成部分ES:语法DOM:对象模型 => 通过js代码与页面文档(出现在body中的所有可视化标签)进行交互BOM:对象模型 => 通过js代码与浏览器自带功能进行交互 引入 ...
- JavaScript三种弹出框(alert,confirm和prompt)用法举例
http://blog.csdn.net/lucky51222/article/details/45604681 我们在做网页交互的时候往往需要用户在操作之前弹出一个提示消息框来让用户做一些点击才能继 ...
- JavaScript 消息框+特殊字符
JavaScript 中创建三种消息框:警告框.确认框.提示框: 1.警告框: 警告框经常用于确保用户可以得到某些信息. 当警告框出现后,用户需要点击确定按钮才能继续进行操作 语法:alert(&qu ...
- js中三种弹出框
javascript的三种对话框是通过调用window对象的三个方法alert(),confirm()和prompt()来获得,可以利用这些对话框来完成js的输入和输出,实现与用户能进行交互的js代码 ...
- javascript消息框
JavaScript有三种消息框: 警告框:alert() alert("我是警告框!!") 确认框:confirm() function show_confirm() { var ...
- android 三种弹出框之一PopupWindow
PopupWindow 在android的弹出框我目前了解到的是有三种:AlertDialog,PopupWindow,Activity伪弹框, AlertDialog太熟悉了,这里就不介绍了 就先看 ...
随机推荐
- 2014 SummerTrain Beautiful Garden
There are n trees planted in lxhgww's garden. You can assume that these trees are planted along the ...
- Codeforces - 1088B - Ehab and subtraction - 堆
https://codeforc.es/contest/1088/problem/B 模拟即可. #include<bits/stdc++.h> using namespace std; ...
- 在iOS中去掉input的光标
在input上添加 readonly unselectable="on" οnfοcus="this.blur()" 就可以了.
- idea模块搭建新手党常见错误
一.搭建java和web模块会出现的错误(此篇以分布式模块为例) 1.创建空工程 1.点击file ,在弹出的窗口左侧选项中在最后有一个Empty Project选项.此处就是创建空工程. 2.在此空 ...
- 64-基于TMS320C6455、XC5VSX95T 的6U CPCI无线通信处理平台
基于TMS320C6455.XC5VSX95T 的6U CPCI无线通信处理平台 1. 板卡概述 本板卡由我公司自主研发,基于CPCI架构,符合PICMG2.0 D3.0标准,包含双TI TMS3 ...
- globalAlpha 示例
代码实例: <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF ...
- objc_setAssociatedObject 关联对象
使用场景:在分类中,不允许创建实例变量,这里就解决了此问题 参考: https://www.cnblogs.com/someonelikeyou/p/7162613.html 属性的实质:就是实例变量 ...
- paper 152: face pose synthesis
先阅读一下几位大神总结的关于姿态合成方面的博客. Head Pose Estimation Using AAM and POSIT http://blog.csdn.net/lliming2006/a ...
- Alex and Number
Alex and Number 时间限制: 1 Sec 内存限制: 128 MB提交: 69 解决: 12[提交][状态] 题目描述 Alex love Number theory. Today ...
- window安装oracle和创建数据库
原文地址: https://www.cnblogs.com/hoobey/p/6010804.html #11g安装 https://www.cnblogs.com/qq1272850043/p/6 ...