I'm attempting to hide the iPad soft keyboard when the user clicks outside a text field.
Specifically somewhere on the form or body that contains no other elements.
Using jquery, jquery mobile, and html5.
I'm attempting to hide the iPad soft keyboard when the user clicks outside a text field.
Specifically somewhere on the form or body that contains no other elements.
Using jquery, jquery mobile, and html5.
document.activeElement.blur();
using mattwindwer's solution (but with more details):
$(document).click(function() {
document.activeElement.blur();
});
Calling focus()
method on a button (even hidden buttons) hides the keyboard. I have used this in my ipad web app.
You can add a click listener to body and using target property of the event, you can determine when to hide the keyboard.