-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathOption-Submit-5Cities.html
More file actions
74 lines (64 loc) · 2.29 KB
/
Option-Submit-5Cities.html
File metadata and controls
74 lines (64 loc) · 2.29 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
<!DOCTYPE html>
<html lang="bn">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>প্রিয় শহর তালিকা</title>
<style>
label {
display: block;
}
</style>
</head>
<body>
<form id="cityForm">
<label>
<input type="checkbox" name="city" value="নিউ ইয়র্ক"> নিউ ইয়র্ক
</label>
<label>
<input type="checkbox" name="city" value="প্যারিস"> প্যারিস
</label>
<label>
<input type="checkbox" name="city" value="টোকিও"> টোকিও
</label>
<label>
<input type="checkbox" name="city" value="লন্ডন"> লন্ডন
</label>
<label>
<input type="checkbox" name="city" value="সিডনি"> সিডনি
</label>
<label>
<input type="checkbox" name="city" value="দুবাই"> দুবাই
</label>
<label>
<input type="checkbox" name="city" value="লস এ্যাঞ্জেলেস"> লস এ্যাঞ্জেলেস
</label>
<label>
<input type="checkbox" name="city" value="রোম"> রোম
</label>
<label>
<input type="checkbox" name="city" value="বেইজিং"> বেইজিং
</label>
<button type="button" onclick="showSelectedCities()">জমা দিন</button>
</form>
<div id="selectedCities"></div>
<script>
function showSelectedCities() {
const selectedCities = document.querySelectorAll('input[name="city"]:checked');
const resultDiv = document.getElementById('selectedCities');
if (selectedCities.length >= 5) {
resultDiv.innerHTML = "<p>আপনার নির্বাচিত শহরগুলি:</p>";
const citiesList = document.createElement('ul');
for (let i = 0; i < 5; i++) {
const listItem = document.createElement('li');
listItem.textContent = selectedCities[i].value;
citiesList.appendChild(listItem);
}
resultDiv.appendChild(citiesList);
} else {
resultDiv.innerHTML = "<p>অনুগ্রহ করে অল্পতম 5 টি শহর নির্বাচন করুন।</p>";
}
}
</script>
</body>
</html>