<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<script>
function myFunction(){
alert("你好,我是一个警告框!");
}
</script>
</head>
<body> <input type="button" onclick="myFunction()" value="显示警告框" /> </body>
</html>

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>菜鸟教程(runoob.com)</title>
</head>
<body> <p>点击按钮,显示确认框。</p>
<button onclick="myFunction()">点我</button>
<p id="demo"></p>
<script>
function myFunction(){
var x;
var r=confirm("按下按钮!");
if (r==true){
x="你按下了\"确定\"按钮!";
}
else{
x="你按下了\"取消\"按钮!";
}
document.getElementById("demo").innerHTML=x;
}
</script> </body>
</html>

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>菜鸟教程(runoob.com)</title>
</head>
<body> <p>点击按钮查看输入的对话框。</p>
<button onclick="myFunction()">点我</button>
<p id="demo"></p>
<script>
function myFunction(){
var x;
var person=prompt("请输入你的名字","Harry Potter");
if (person!=null && person!=""){
x="你好 " + person + "! 今天感觉如何?";
document.getElementById("demo").innerHTML=x;
}
}
</script> </body>
</html>

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>菜鸟教程(runoob.com)</title>
</head>
<body> <p>点击按钮在弹窗总使用换行。</p>
<button onclick="myFunction()">点我</button>
<p id="demo"></p>
<script>
function myFunction(){
alert("Hello\nHow are you?");
}
</script> </body>
</html>

最新文章

  1. HTML开源框架
  2. 可编辑的div元素去除粘贴复制带来的额外样式,实现纯文本粘贴
  3. EffectiveJava——复合优先于继承
  4. [百度空间] [原]android下的各种坑
  5. asp.net将sql语句封装在类库中
  6. 一些硬件厂商的MAC号
  7. at命令
  8. oracle中简单查询语句的格式及执行顺序分析
  9. css background-position (图片裁取)
  10. pug模板引擎(原jade)
  11. python3爬虫之入门和正则表达式
  12. spring cloud配置高可用eureka时遇到的一些坑
  13. github提交代码失败
  14. RuntimeException: Type &quot;nmethodBucket*&quot;, referenced in VMStructs::localHotSpotVMStructs in the remot
  15. 2017-2018-2 20165306 实验三《敏捷开发与XP实践》实验报告
  16. Vim NerdTree
  17. SpingMVC的&lt;context:component-scan&gt;包扫描踩坑记录
  18. MATLAB左除和右除
  19. 汇编_指令_XCHG
  20. Unknown type name &#39;NSString&#39;

热门文章

  1. Golang的循环结构-for语句
  2. Golang的常量定义及使用案例
  3. 转载-- SQL连接查询2 外连接(左右联接查询)
  4. C++ 根据日期判断星期几
  5. oracle开机启动
  6. Django——include()三种使用方法
  7. zerone 01串博弈问题
  8. 解决对路径bin\roslyn..的访问被拒绝
  9. 第十四篇Django-model进阶(中介模型,查询优化,extra,整体插入)
  10. 关于boostrap的TAB切换 ,如何获取?