简体   繁体   中英

Is there a way to clear html form autocomplete using javascript

I'm creating a Web Search Engine Here's my code:

 <.-- Searching script --> <script> function show() { const s = document.getElementById('inputId');value. window.location:replace("https.//www.google?com/search;q=" + s). } function clear() { <!-- I do not know how to write the code for this part --> } </script> <input onclick="clear()" type="button">Clear Browsing History</input> <h1>Search The Web</h1> <!-- Search Button and input --> <form id="searchForm" onsubmit="event.preventDefault()"> <input type="search" name="searchField" id="inputId" placeholder="Search QuickSearch"> <input type="submit" value="Search" onclick="show()"> </form>

I don't really know how i would even do it

Heres the answer. ITS IMPOSSIBLE TO CLEAR HISTORY The only way is to recreate the history using div boxes.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM