MCPcopy Create free account
hub / github.com/Vishal-raj-1/Awesome-JavaScript-Projects / showClearTextButton

Function showClearTextButton

assets/js/WikiSearch.js:40–50  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

38};
39
40const showClearTextButton = () => {
41 const search = document.getElementById("search");
42 const clear = document.getElementById("clear");
43 if (search.value.length) {
44 clear.classList.remove("none");
45 clear.classList.add("flex");
46 } else {
47 clear.classList.add("none");
48 clear.classList.remove("flex");
49 }
50};
51
52const clearSearchText = (event) => {
53 event.preventDefault();

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected