On my website I have a search box (text input field). When the user clicks on it and begins to enter text, a menu of links appears. The menu appears through jQuery. The following command displays the menu:
".focus(function() { $("#instant_search_wrapper").show(); }); "
When the user clicks the search button, I want the menu to disappear.
The easiest way to do this is to use the following command:
".blur(function() { $("#instant_search_wrapper").hide(); });"
However, if I do this, then when the user clicks on the link in the menu, the text input field loses focus, and therefore the menu disappears before the user is sent to the selected page. How can I do this so that the menu disappears when the search field loses focus (but if the user clicks on the link before the search field loses focus, s / he can still be taken into the link)?
source share