Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,18 @@
<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>
Expand All @@ -14,6 +24,14 @@

<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>