There are two elements in play:
$(\'#myInput\') // an input field for search
$(\'#myList\') // a list to display search results
I want to h
You need to be able to say "do this blur() unless the list gains focus at the same time".
This question says how to detect if an element has focus: Using jQuery to test if an input has focus
Then all you need to do is:
$("#myInput").blur(function () {
if (!$("#myList").is(":focus")) {
$("#myList").hide();
}
});