How to hide the keyboard in the jQuery Mobile page in a Phonegap application?


I have a problem with hiding keyboard in the iPhone simulator. My HTML code:

<form id="my_form">
    <input type="search" id="searchBar" />

jQuery code:

$("#my_form").submit(function() {
  one = $('#searchBar').val();
  return false;

Everything works as I need: I can get form value and perform some Ajax. But when the function returns false, the virtual keyboard in the iPhone simulator is still visible. How to hide the keyboard? Is there another method to do that? I need to pass data to the server using Ajax when the user searches and presses 'Go' on the iPhone. The search result should be shown in the same page (already done). The user can again search in the same page.

Please help me.



Instead of switching focus to another element you can simply blur your input like this:


It will hide the virtual keyboard.