-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Expand file tree
/
Copy pathindex.html
More file actions
37 lines (33 loc) · 1.06 KB
/
index.html
File metadata and controls
37 lines (33 loc) · 1.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
<!doctype html>
<head>
<meta charset="utf-8">
<script>
// TODO: create a handler
const handleSetSearchEngine = () => {
const form = document.getElementbyId('searchForm');
const selectedEngine = document.querySelector('input[name=engine]:checked');
const searchTerm = document.querySelector('input[name=q]').value;
let actions = {
"google": "https://www.google.com"
}
}
window.addEventListener("load", function(){
// TODO: register the handler
const form = document.getElementById('searchForm');
form.addEventListener('submit', handleSetSearchEngine)
});
</script>
</head>
<body>
<form id="searchForm">
<!-- TODO: add form elements -->
<form>
<input type="text" name="q"/>
<label>Google<input type="radio" name="engine" value="google"/></label>
<label>DuckDuckGo<input type="radio" name="engine" value="duckduckgo"/></label>
<label>Bing<input type="radio" name="engine" value="bing"/></label>
<label>Ask<input type="radio" name="engine" value="ask"/></label>
<input type="submit" value="Go!">
</form>
</form>
</body>