-
Notifications
You must be signed in to change notification settings - Fork 0
/
index4.html
58 lines (48 loc) · 1.79 KB
/
index4.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
<!-- Survey Form with Range Input and Color Picker -->
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Survey Form</title>
</head>
<body>
<h1>Survey Form</h1>
<form action="#" method="post">
<fieldset>
<legend>Survey Questions</legend>
<div>
<label for="name">Name:</label>
<input type="text" id="name" name="name" required minlength="2" maxlength="50" placeholder="Enter your name">
</div>
<div>
<label for="age">Age:</label>
<input type="number" id="age" name="age" min="0" max="120" required placeholder="Enter your age">
</div>
<div>
<label for="rating">Rating:</label>
<input type="range" id="rating" name="rating" min="1" max="10" step="1" value="5">
<output for="rating" id="ratingOutput">5</output>
<script>
const ratingInput = document.getElementById('rating');
const ratingOutput = document.getElementById('ratingOutput');
ratingInput.oninput = () => {
ratingOutput.value = ratingInput.value;
};
</script>
</div>
<div>
<label for="color">Favorite Color:</label>
<input type="color" id="color" name="color" value="#000000">
</div>
<div>
<label for="feedback">Additional Feedback:</label>
<textarea id="feedback" name="feedback" rows="4" placeholder="Provide your feedback"></textarea>
</div>
<div>
<input type="submit" value="Submit Survey">
</div>
</fieldset>
</form>
</body>
</html>