function myFunctionAlert(){
window.alert(''this is an alert, it has a confirm button'')
document.getElementById(''action'').value = ''you just clicked confirm button of alert()''
}
function myFunctionConfirm(){
var result = window.confirm(''this is a confirm,it has a confirm button and a cancel button'')
if(result == true){
document.getElementById(''action'').value = ''you just clicked confirm button of confirm()''
}else if(result == false){
document.getElementById(''action'').value = ''you just clicked cancel button of confirm()''
}else{
document.getElementsById(''action'').value = ''you did nothing''
}
}
function myFunctionPrompt(){
var result = window.prompt(''this is a prompt,it has an input and two buttons'')
if(result == null){
document.getElementById(''action'').value = ''you just clicked cancel button of prompt()''
}else if(result == ''''){
document.getElementById(''action'').value = ''you just input nothing and clicked confirm button of prompt()''
}else{
document.getElementById(''action'').value = ''you just input \'''' + result + ''\'' and clicked confirm button of promt()''
}
}
show alert
show confirm
show prompt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42