-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathP6.html
More file actions
77 lines (77 loc) · 2.13 KB
/
P6.html
File metadata and controls
77 lines (77 loc) · 2.13 KB
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<script>
// let a = prompt("Enter Your Age:")
// a = Number.parseInt(a)
// if(a>=18){
// alert("You can drive")
// }
// else{
// alert("You can not drive")
// }
//######### Q-1
// let age = prompt("Enter Your age")
// age = Number.parseInt(age)
// const canDrive = (age)=>{
// return age>=18?true:false
// }
// if(canDrive(age)){
// alert("You can Drive")
// }
// else{
// alert("You cannot Drive")
// }
//######Q-2
// let runAgain = true;
// let age = prompt("Enter Your age")
// age = Number.parseInt(age)
// while(runAgain){
// const canDrive = (age)=>{
// return age>=18?true:false
// }
// if(canDrive(age)){
// alert("You can Drive")
// }
// else{
// alert("You cannot Drive")
// }
// }
//#####Q-3
// let runAgain = true;
// while(runAgain){
// let age = prompt("Enter Your age")
// age = Number.parseInt(age)
// if(age<0){
// console.error("please enter a valid age");
// break;
// }
// const canDrive = (age)=>{
// return age>=18?true:false
// }
// if(canDrive(age)){
// alert("You can Drive")
// }
// else{
// alert("You cannot Drive")
// }
// }
//####Q-4
// let number = prompt("Enter Your number")
// number = Number.parseInt(number)
// if(number > 4) {
// location.href = "https://google.com"
// }
//#####Q-5
let color=prompt("Enter The Page Background Color")
document.body.style.backgroundColor = color;
</script>
</head>
<body>
Hii
<!-- <div class="new" id="new1"></div> -->
</body>
</html>