iPad Safari - Make keyboard disappear

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();
};

I had iPad with iOS 5.0.1 not hiding the keyboard after successful login on my site. I solved by simply executing the javascript command

document.activeElement.blur();

after successful login and now the keyboard is correctly hidden :-)