Skip to content

Commit e58ab25

Browse files
author
Edward King
committed
worked on studio
1 parent f4602f3 commit e58ab25

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

user-input-with-forms/studio/index.html

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,15 @@
66
// TODO: create a handler
77
window.addEventListener("load", function(){
88
// TODO: register the handler
9+
let searchForm = document.getElementById("searchForm");
10+
let goog
11+
searchForm.addEventListener("submit", function(){
12+
if (searchForm.value === "google"){
13+
searchForm.action = "https://www.google.com/search?";
14+
};
15+
16+
});
17+
918
});
1019
</script>
1120
</head>
@@ -14,6 +23,24 @@
1423

1524
<form id="searchForm">
1625
<!-- TODO: add form elements -->
26+
<input type="text" name="q">
27+
<label>
28+
<input type="radio" name="engine" value="google">
29+
Google
30+
</label>
31+
<label>
32+
<input type="radio" name="engine" value="duckduckgo">
33+
DuckDuckGo
34+
</label>
35+
<label>
36+
<input type="radio" name="engine" value="bing">
37+
Bing
38+
</label>
39+
<label>
40+
<input type="radio" name="engine" value="ask">
41+
Ask
42+
</label>
43+
<button>Go!</button>
1744
</form>
1845

1946
</body>

0 commit comments

Comments
 (0)