-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjs16.html
More file actions
30 lines (24 loc) · 748 Bytes
/
js16.html
File metadata and controls
30 lines (24 loc) · 748 Bytes
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
<!--js dialogs => 3 types
alert dialog=> used to display msg to users
syn: window.alert(text/expr)
prompt dialog=> used to accept data from user
syn: window.prompt(text)
confirm dialog=> used to cross check/confirmation from user
syn: window.confirm(text)
-->
<!--demo on js dialogs-->
<h3>demo on alert, confirm & prompt</h3>
<script>
/* window.alert("Happy Makar sakranti");
alert("Product is "+ 20*4);
let x=window.confirm("do want to exit?");
document.write(x,'<br>');
if(x===true)
closing code
else
nothing to do
*/
let n=window.prompt("enter name");
let a=prompt("enter age","0");
document.write(n+" "+a+" "+"year(s) older");
</script>