For example, what you type on Stackoverflow.com's search engine is preserved.
https://stackoverflow.com/questions/tagged/javascript
document.addEventListener('keydown', (e) => { if (e.ctrlKey && e.shiftKey && e.key == 'F') { // F = 70 let target = document.querySelector("#search > div > input"); target.value = 'America'; target.focus(); } });
However, not all text areas and forms seem to be preserved.
For example, in a search engine on another Q & A site:
document.addEventListener('keydown', (e) => { if (e.ctrlKey && e.shiftKey && e.key == 'F') { // F = 70 let target = document.querySelector(".SearchBox_searchBox__inputBoxInput__nf3fq"); target.value = 'America'; target.focus(); } });
https://chiebukuro.yahoo.co.jp/search?p=&fr=common-navi
If you do not enter the space
key etc. at the end after entering it, it will be erased.
If you press the ENTER key after typing to search, the characters you typed will be erased or remain.
I want to know the cause when it is erased.
What is the cause?
Is there a solution?
https://stackoverflow.com/questions/67051358/what-you-enter-in-a-particular-form-is-not-preserved April 12, 2021 at 08:28AM
没有评论:
发表评论