-
Notifications
You must be signed in to change notification settings - Fork 17
Expand file tree
/
Copy pathindex.html
More file actions
68 lines (60 loc) · 2.11 KB
/
index.html
File metadata and controls
68 lines (60 loc) · 2.11 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
<!-- That's right... it's completely empty. Scary! Don't worry - that's what boilerplate is for! You DID read the directions all the way through, right? -->
<!-- Remember to start by typing a single exclamation point (!) and then hitting enter or selecting the first dropdown option.-->
<!-- This will give you the basic, necessary skeletal elements of a webpage so you can begin coding to our specific requirements! -->
<!-- Good luck! You've got this! -->
<html>
<head>
<meta charset="UTF-8" />
<title>Unit 4 Excercise</title>
</head>
<body>
<div>
<label>
Username:
<input type="username" name="username" placeholder="Enter your username" required>
</label>
</div>
<div>
<label>
What is your favorite fruit?
<input type="checkbox" name="fruit" value="Apple"> Apple
<input type="checkbox" name="fruit" value="Banana"> Banana
<input type="checkbox" name="fruit" value="Orange"> Orange
</label>
</div>
<div>
<label>
Select a gender:
<input type="radio" name="gender" value="male" required> Male
<input type="radio" name="gender" value="female" required> Female
<input type="radio" name="gender" value="other" required> Other
</label>
</div>
<div>
<label>
Select a Country:
<select name="country" required>
<option value="Select a Country">Select a Country</option>
<option value="usa">USA</option>
<option value="canada">Canada</option>
<option value="uk">UK</option>
</select>
</label>
<div>
<script>
function handleFormSubmit(event) {
event.preventDefault();
var username = document.forms["myForm"]["username"].value;
var fruit = document.forms["myForm"]["fruit"].value;
var gender = document.forms["myForm"]["fruit"].value;
var country = document.forms["myForm"]["country"].value;
alert("Form submitted!");
}
</script>
</div>
<form action="/submit-form" method="POST">
<input type="submit" value="Submit">
</form>
</div>
</body>
</html>