-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfeedback.html
More file actions
139 lines (118 loc) · 3.06 KB
/
Copy pathfeedback.html
File metadata and controls
139 lines (118 loc) · 3.06 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
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<title>Feedback Form</title>
<style>
body {
font-family: Arial, sans-serif;
background-color: #f1f1f1;
margin: 0;
padding: 0;
}
.container {
max-width: 500px;
margin: 40px auto;
background-color: white;
padding: 30px;
border-radius: 10px;
box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}
h1, h2 {
text-align: center;
color: #333;
}
label {
font-weight: bold;
display: block;
margin-top: 15px;
}
input, textarea {
width: 100%;
padding: 12px;
margin-top: 5px;
border: 1px solid #ccc;
border-radius: 6px;
font-size: 14px;
}
button {
width: 100%;
padding: 12px;
margin-top: 20px;
background-color: #4CAF50;
color: white;
border: none;
border-radius: 6px;
font-size: 16px;
cursor: pointer;
}
button:hover {
background-color: #45a049;
}
.feedback-list {
margin-top: 30px;
}
.feedback-item {
background-color: #f9f9f9;
padding: 15px;
border-radius: 8px;
margin-bottom: 10px;
border: 1px solid #ddd;
}
.feedback-item h4 {
margin: 0;
}
.feedback-item p {
margin: 5px 0;
}
@media screen and (max-width: 600px) {
.container {
margin: 20px;
padding: 20px;
}
input, textarea, button {
font-size: 14px;
}
}
</style>
</head>
<body>
<div class="container">
<h1>Week1 intermediate task</h1>
<h2>Feedback Form</h2>
<label for="name">Full Name</label>
<input type="text" id="name" placeholder="Your Name" />
<label for="email">Email</label>
<input type="email" id="email" placeholder="Your Email" />
<label for="feedback">Feedback</label>
<textarea id="feedback" rows="4" placeholder="Your Feedback"></textarea>
<button onclick="submitFeedback()">Submit Feedback</button>
<h3>Submitted-feedbacks:</h3>
<div id="feedbackList" class="feedback-list"></div>
</div>
<script>
function submitFeedback() {
const name = document.getElementById("name").value.trim();
const email = document.getElementById("email").value.trim();
const feedback = document.getElementById("feedback").value.trim();
if (name && email && feedback) {
const feedbackDiv = document.createElement("div");
feedbackDiv.className = "feedback-item";
feedbackDiv.innerHTML = `
<h4>${name}</h4>
<p><em>(${email})</em></p>
<p>${feedback}</p>
`;
document.getElementById("feedbackList").prepend(feedbackDiv);
// Optionally clear fields
document.getElementById("name").value = "";
document.getElementById("email").value = "";
document.getElementById("feedback").value = "";
} else {
alert("Please fill out all fields!");
}
}
</script>
</body>
</html>