-
Notifications
You must be signed in to change notification settings - Fork 0
/
practice.html
169 lines (128 loc) · 4.27 KB
/
practice.html
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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<input type="text">
<button onclick="change()">Click</button>
<h2></h2>
<img src="pak.png" id="image" style="display: none; width: 20rem;">
<script>
let val = document.querySelector('input');
function change(){
if(val.value == '14 August'){
document.getElementById('image').style.display = 'block';
document.querySelector('h2').innerHTML = ""
}
else{
document.querySelector('h2').innerHTML = "No festival"
}
}
// function change(){
// let para = document.getElementById('para');
// para.innerHTML = "Hello world 2 ";
// para.style.background = "red"
// para.style.color = "white";
// }
// Task 01:
// let name1 = prompt('Enter any word');
// let name3 = name1.toLowerCase()
// let name4 = name3.split("").reverse().join("");
// if (name3 == name4) {
// document.write('true')
// }
// else {
// document.write('False')
// }
// Task 02:
// let array = [2, 24, 21, 16, 7, 4]
// let max = Math.max(...array);
// console.log(max);
// Task 03:
// let totalMaks = +prompt('Enter your total numbers out of 250');
// let ans = totalMaks / 2.5;
// console.log("Your Percentage is: " + ans + "%");
// Tak 04:
// let marks = [26, 12, 31, 23, 75, 110, 82];
// // Print Before sorting array
// console.log("Original Array");
// console.log(marks);
// // Sort elements using compare method
// marks.sort(function(a, b){return a - b});
// console.log("After sorting in Ascending order");
// // Print sorted Numeric array
// console.log(marks);
// Task 05:
// let a = +prompt('Enter value of a');
// let b = +prompt('Enter value of b');
// let c = +prompt('Enter value of c');
// let sum = a + b + c
// let S = sum/2;
// alert('Value of S= ' + S)
// let Sa = S - a;
// let Sb = S - b;
// let Sc = S - c;
// let result = S * Sa * Sb * Sc;
// alert('The area of a Rectangle is: ' + result)
// Task 06:
// let string = prompt('Enter value of a');
// const text = /[aeiou]/gi;
// let test = string.match(text);
// console.log(test.length + " vowels are found!");
// Task 07:
// let number = +prompt('Enter your number');
// let power = +prompt('Enter the power');
// let result = Math.pow(number, power)
// console.log('The power of ' + number + ' is ' + result);
// Task 08:
// let subject1 = +prompt('Enter your number out of 100');
// let subject2 = +prompt('Enter your number out of 100');
// let subject3 = +prompt('Enter your number out of 100');
// let total = subject1 + subject2 + subject3;
// let average = total/3
// console.log('You obtained ' + total + '/300 and average is ' + average);
// Task 09:
// function checkLeapYear(year){
// if(year % 4 == 0 && year % 100 != 0 || year % 400 == 0){
// console.log('The year is a leap year')
// }
// else{
// console.log('The year is not a leap year')
// }
// }
// let year = prompt('Enter your year');
// checkLeapYear(year);
// Task 10:
// let distance = +prompt('Ente the distance in kilometer!');
// let meters = distance * 100;
// let feet = distance * 3280.839895;
// let inches = distance * 39370.1;
// let centimeter = distance * 100000;
// console.log('Your conversion: ' + meters +"cm, " + feet +"fts, " + centimeter +"cm, " + inches +"inch")
// Task 11:
// let hoursWorked = +prompt('Enter the no of hours of you worked as overtime!');
// alert("You'll get paid " + hoursWorked *12 +"rs")
// Task 12:
// let amount = +prompt('Ente the amount !');
// let fiveHundred = amount/500;
// let fifty = amount%500;
// fifty = fifty/50;
// let tens = amount% 500;
// tens = tens%50;
// tens = tens/10;
//Task 13:
// let string = prompt('Enter your text');
// let find = prompt('Enter your word');
// for(let )
// if(string== find){
// }
// Task 14:
let a = prompt('hi')
setInterval(a, 1000)
</script>
</body>
</html>