<div class="separator" style="clear: both; text-align: center;"><a href="https://1.bp.blogspot.com/-Ba1y96oRF28/XUOZdMgPMZI/AAAAAAAAGQc/DecP1W3qD7gL-7gR9ByQd7p1Ghr-u1rpwCLcBGAs/s1600/refocus.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img alt="How to re-focus to a text field when focus is lost on a HTML form?" border="0" data-original-height="900" data-original-width="1600" height="360" src="https://1.bp.blogspot.com/-Ba1y96oRF28/XUOZdMgPMZI/AAAAAAAAGQc/DecP1W3qD7gL-7gR9ByQd7p1Ghr-u1rpwCLcBGAs/s640/refocus.jpg" title="How to re-focus to a text field when focus is lost on a HTML form?" width="640" /></a></div><div class="separator" style="clear: both; text-align: center;"></div><br /><b>HTML:</b><br /><pre><code class="language-html"><input type='text' id='thingy' onblur="refocus(this);"></code></pre><br /><b>Script:</b><br /><pre><code class="language-js"> function refocus(elm) { setTimeout(go, 0); function go() { elm.focus(); } } </code></pre>
Posting Komentar
Posting Komentar