Skip to content

Commit a5b1fb8

Browse files
committed
User Input with Forms
1 parent b89665f commit a5b1fb8

File tree

2 files changed

+20
-4
lines changed

2 files changed

+20
-4
lines changed

css/exercises/HTML-Me-Something-Start

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
Subproject commit bf2d4c033c22daed6d16cf4868d508bc56c889d6
1+
Subproject commit 1007233800eba9aced5b5a13fc0079c8264c460a

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

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,33 @@
33
<head>
44
<meta charset="utf-8">
55
<script>
6+
let button=document.getElementById("submit");
7+
8+
69
// TODO: create a handler
710
window.addEventListener("load", function(){
8-
// TODO: register the handler
11+
button.addEventListener("click", setSearchEngine());
12+
function setSearchEngine() {
13+
14+
console.log("Test");
15+
}
16+
// TODO: register the handler
917
});
1018
</script>
1119
</head>
1220

1321
<body>
1422

15-
<form id="searchForm">
23+
<form id="searchForm" action="">
1624
<!-- TODO: add form elements -->
17-
</form>
25+
<input type="text" name="q">
26+
<label>Google</label><input type="radio" name="engine" value="google"/>
27+
<label>DuckDuckGo</label><input type="radio" name="engine" value="duckDuckGo"/>
28+
<label>Bing</label><input type="radio" name="engine" value="Bing"/>
29+
<label>Ask</label><input type="radio" name="engine" value="ask"/>
30+
31+
<button id="submit">Go</button>
32+
</form>
33+
1834

1935
</body>

0 commit comments

Comments
 (0)