window对象方法(alert-confirm-prompt)
<!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>window对象方法(alert-confirm-prompt)</title>
<!--
alert("a");//弹出一个提示框,提示内容为:a
confirm("a");//弹出一个带有提示信息a和确认/取消的对话框
prompt("a");//弹出一个带有提示信息a、输入框和确认/取消的对话框
扩展知识:换行符:\n
-->
</head>
<body>
<input id="inp" type="button" value="删除" />
<script>
var a=document.getElementById("inp");
a.onclick=function (){
if (confirm ("您确定要删除吗")){
alert("已删除")
}else{
alert("已取消")
}
}
</script>
</body>
</html>
window对象方法(alert-confirm-prompt)的更多相关文章
- window对象属性alert、confirm、prompt怎么使用?
window对象属性alert.confirm.prompt怎么使用? 一.总结 1.参数依次复杂,返回值依次复杂,但是感觉都是一一继承的,所以很好想也很好写. 二.window对象alert.con ...
- BOM window对象方法
window对象方法 alert():弹出一个警告对话框. prompt():弹出一个输入对话框. confirm():弹出一个确认对话框.如果单击“确定按钮”返回true,如果单击“取消 ...
- Java Selenium - 几种对话框处理Alert\confirm\prompt
1. Alert , 先用常规办法定位到能触发alert的按钮 , 然后 Alert alert = driver.switchTo().alert(); alert.accept(); 如果aler ...
- alert/confirm/prompt 处理
webdriver 中处理JavaScript 所生成的alert.confirm 以及prompt 是很简单的.具体思路是使用switch_to_alert()方法定位到alert/confirm/ ...
- 转:python webdriver API 之alert/confirm/prompt 处理
webdriver 中处理 JavaScript 所生成的 alert.confirm 以及 prompt 是很简单的.具体思路是使用switch_to.alert()方法定位到 alert/conf ...
- selenium python (十一)alert/confirm/prompt的处理(js中的弹出框)
webdriver中处理js所生成的alert.confirm以及prompt,采用switch_to_alert()方法定位到alert/confirm/prompt.然后使用text/accept ...
- Python脚本控制的WebDriver 常用操作 <二十二> 处理alert / confirm / prompt
测试用例场景 webdriver中处理原生的js alert confirm 以及prompt是很简单的.具体思路是使用switch_to.alert()方法定位到alert/confirm/prom ...
- 2.11 alert\confirm\prompt
2.11 alert\confirm\prompt 前言 不是所有的弹出框都叫alert,在使用alert方法前,先要识别出到底是不是alert.先认清楚alert长什么样子,下次碰到了,就可以用 ...
- Python+Selenium学习--alert/confirm/prompt 处理
场景 webdriver 中处理JavaScript 所生成的alert.confirm 以及prompt 是很简单的.具体思路是使用switch_to.alert()方法定位到alert/confi ...
随机推荐
- Vue框架(三)——Vue项目搭建和项目目录介绍、组件、路由
Vue项目环境搭建 1) 安装node,在官网下载好,然后在本地安装 官网下载安装包,傻瓜式安装:https://nodejs.org/zh-cn/ 2) 换源安装cnpm >: npm ins ...
- python 递归-汉诺塔
# 汉诺塔 a = "A" b = "B" c = "C" def hano(a, b, c, n): if n == 1: print(& ...
- Scala Spark WordCount
Scala所需依赖 <dependency> <groupId>org.scala-lang</groupId> <artifactId>scala-l ...
- mapreduce课堂测试结果
package mapreduce; import java.io.IOException; import java.util.StringTokenizer; import org.apache.h ...
- Spring-Cloud之Config配置中心-7
一.我们前面基本上都是讲解的Spring Cloud Netflix的组件,下面我们会重点说Spring Cloud Config分布式配置中心.为什么需要这个组件来管理配置呢?在分布式应用开发过程中 ...
- Hyper-V虚拟机配置内部网络固定IP 并且连接外网
2019/10/23 Hyper-V CentOS7 摘要:Hyper-V中的虚拟机CentOS7能固定IP并且连接外网 保证宿主机的Xshell始终只用同一个IP连接到该虚拟机 新建内部网络虚拟交换 ...
- K8S 中的容器编排和应用编排
众所周知,Kubernetes 是一个容器编排平台,它有非常丰富的原始的 API 来支持容器编排,但是对于用户来说更加关心的是一个应用的编排,包含多容器和服务的组合,管理它们之间的依赖关系,以及如何管 ...
- aria2 https
https://github.com/aria2/aria2/issues/361 ... and also make sure that aria2 was built with HTTPS sup ...
- 英语affrike非洲
中文名称:阿非利加洲(全称) 外文名称:Africa 别 名:Affrike 行政区类别洲 下辖地区北非.东非.西非.中非.南非 地理位置:东濒印度洋,西临大西洋,北至地中海,南至好望角 面 积:30 ...
- 子网掩码与ip地址的关系
1.什么是ip地址 在网络中,所有的设备都会被分配一个地址.这个地址就相当于某条路上的XX号XX房.其中[号]对应的号码是分配了整个子网的,而[房]对应的号码是分配给子网中的计算机的,这就是网络中的地 ...