-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathchallenge3.html
More file actions
43 lines (42 loc) · 1.05 KB
/
challenge3.html
File metadata and controls
43 lines (42 loc) · 1.05 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Challenge 3</title>
<script type="text/javascript">
/* Your code here */
function checkForm() {
var straw = document.getElementById("optstraw")
var blue = document.getElementById("optblue")
if (straw.checked == false & blue.checked == false) {
alert("Please select your favorite berry!")
return false
}
else {
return true
}
}
</script>
</head>
<body>
<form action="mailto:me@fakeemail.com" onsubmit=
"return checkForm()">
<fieldset>
<legend>Radio buttons and Check Boxes</legend>
<p>
What's your favorite berry?:
<label>
<input type="radio" value="male" name="favfruit" id="optstraw">
Strawberries
</label>
<label>
<input type="radio" value="female" name="favfruit" id="optblue">
Blueberries
</label>
</p>
</fieldset>
<input type="submit" value="Check it out!">
</form>
<a href="challenge4.html">Challenge 4</a>
</body>
</html>