How to keep the Focus on one textbox ? even if you click anywhere in a browser.
$(\"#txtSearch\").focus();
There are other ways of loosing focus than clicking area away from the input i.e. tabbing. If you want to prevent loosing focus use blur event i.e.
document.getElementById('txtSearch').addEventListener('blur', e => { e.target.focus(); });