From fdd37f4d4e6ee135eb6cfd4b67db7c6c0f2e68e3 Mon Sep 17 00:00:00 2001 From: neon_arch Date: Sun, 29 Sep 2024 21:49:12 +0300 Subject: [PATCH] :sparkles: feat: add a function to clear search input text on click event (#394) --- public/static/index.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/public/static/index.js b/public/static/index.js index 515065a..c743497 100644 --- a/public/static/index.js +++ b/public/static/index.js @@ -32,3 +32,10 @@ searchBox.addEventListener('keyup', (e) => { searchWeb() } }) + +/** +* A function that clears the search input text when the clear button is clicked. +*/ +function clearSearchText() { + document.querySelector('.search_bar input').value = '' +}