THEOWEB.DEV

WhatsappBot, BrowserAutomation, TelegramBot, JabberBot, IBankingBot, custom software developer, internet marketing

How To re-Focus To a Text Field When Focus is Lost on a HTML Form?

How To re-Focus To a Text Field When Focus is Lost on a HTML Form?

How to re-focus to a text field when focus is lost on a HTML form?

HTML:
<input type='text' id='thingy' onblur="refocus(this);">

Script:

function refocus(elm) {

    setTimeout(go, 0);

    function go() {
        elm.focus();
    }
}

Posting Komentar

Protected By Copyscape