From 3857f1a0de8e3fd5d99b0879e7eaaaad7679b36d Mon Sep 17 00:00:00 2001 From: IndieHum Date: Mon, 20 Jan 2025 10:34:32 +0330 Subject: [PATCH] now it is work --- js/main.js | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/js/main.js b/js/main.js index bea7bb8..6a820c8 100644 --- a/js/main.js +++ b/js/main.js @@ -1,11 +1,12 @@ const SearchBtn = document.getElementById("search-btn"); -const SearchValue = document.getElementById("search").value; +// const SearchValue = document.getElementById("search").value; const SEnodes = document.querySelectorAll("input[type='checkbox']"); let SEchecked = []; const searchFunc = () => { // check for SE + const SearchValue = document.getElementById("search").value; console.log(SearchValue) console.log(SEnodes) @@ -20,16 +21,20 @@ const searchFunc = () => { SEchecked.forEach(n => { switch (n.id) { case 'google': - // https://www.google.com/search?q={SearchValue} + // https://www.google.com/search?q=${SearchValue} + window.open(`https://www.google.com/search?q=${SearchValue}`) break; case 'ddg': - // https://duckduckgo.com/{SeachValue} + // https://duckduckgo.com/${SearchValue} + window.open(`https://duckduckgo.com/${SearchValue}`) break; case 'bing': - // https://www.bing.com/search?q={SearchValue} + // https://www.bing.com/search?q=${SearchValue} + window.open(`https://www.bing.com/search?q=${SearchValue}`) break; case 'wiki': - // https://en.wikipedia.org/wiki/{SearchValue} + // https://en.wikipedia.org/wiki/${SearchValue} + window.open(`https://en.wikipedia.org/wiki/${SearchValue}`) break; } });