I want hide virtual keyboard on ipad device when some plugin ( or other code) set focus to input element on html page using pure javascript( or jquery library)
If you need a pure javascript solution, use this line :
document.activeElement.blur();
This line removes the focus on the active element and hiding the keyboard.
Reference
You would have to blur it again but the keyboard might flash.
$('input').on('focus', function() { $(this).blur(); });
Or, depending on if you have dynamically created input
elements.
$('#wrapper').on('focus', 'input', function() { $(this).blur(); });
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With