javascript - Press enter on form input to make it lose focus -
i have form input box , hidden submit field:
<form action="javascript:void(0);"> <input type="text"> <input type="submit" style="display:none;"> </form>
i make when click enter, input box loses focus.
how can accomplish this?
try out. please note need include jquery file work.
<form action="javascript:void(0);"> <input type="text" id="txtfocus"> <input type="submit" style="display:none;" id="btnhidden"> </form> <script> $("#btnhidden").on('click', function() { $('#txtfocus').blur(); }); </script>
Comments
Post a Comment