Skip to content

Instantly share code, notes, and snippets.

@linhyo
Created July 24, 2015 08:57
Show Gist options
  • Save linhyo/0a7c36a95fd43b6b6367 to your computer and use it in GitHub Desktop.
Save linhyo/0a7c36a95fd43b6b6367 to your computer and use it in GitHub Desktop.
Hide the iOS soft keyboard
// Source: http://uihacker.blogspot.com/2011/10/javascript-hide-ios-soft-keyboard.html
var hideKeyboard = function() {
document.activeElement.blur();
var inputs = document.querySelectorAll('input');
for(var i=0; i < inputs.length; i++) {
inputs[i].blur();
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment