aboutsummaryrefslogtreecommitdiff
path: root/search-manager.js
diff options
context:
space:
mode:
authorMark Powers <markppowers0@gmail.com>2020-09-04 22:28:08 -0500
committerMark Powers <markppowers0@gmail.com>2020-09-04 22:28:08 -0500
commit3ad949e08e8e289d6af3b629ab62d686cbef7e48 (patch)
treed6855cf1333d8c9e9ec7078cef0842a2b13000d6 /search-manager.js
Initial commit
Diffstat (limited to 'search-manager.js')
-rw-r--r--search-manager.js11
1 files changed, 11 insertions, 0 deletions
diff --git a/search-manager.js b/search-manager.js
new file mode 100644
index 0000000..6823608
--- /dev/null
+++ b/search-manager.js
@@ -0,0 +1,11 @@
+document.getElementById("searchInput").addEventListener("keyup", function (event) {
+ if (event.keyCode === 13) {
+ event.preventDefault();
+ document.getElementById("searchBtn").click();
+ }
+});
+document.getElementById("searchBtn").addEventListener("click", function (event) {
+ console.log("t");
+ let text = document.getElementById("searchInput").value;
+ window.location.href = "https://duckduckgo.com/?q=" + text;
+}); \ No newline at end of file