Ios – iPad Safari – Make keyboard disappear

iosipadmobile-safari

In iPad Safari browser, when I change focus from a textbox to a dropdown, the keyboard still remains… Is there some way (maybe with Javascript) I can hide the keyboard when user blurs from the textbox?

Indirectly speaking, I am looking for a equivalent of (but in Mobile Safari)

[tempTextField resignFirstResponder]; 

Best Answer

I found the solution for this at http://uihacker.blogspot.com/2011/10/javascript-hide-ios-soft-keyboard.html. Essentially, just do this (it worked for me):

var hideKeyboard = function() {
    document.activeElement.blur();
    $("input").blur();
};