Having trouble with remove
I have a new search suggestions feature that works, but I can't get it to disappear when the user clicks off. I have tried a variety of methods to get this to work. I just can't figure it out.
Here is the function I have come up with up to this point:
- <script>
- var windowObj = window;
- windowObj.onclick(myfunction(){
- $('.results').remove();
- });
- </script>
- <div id="results" class="results"></div>
I know I need code to exclude the clicks on the search results, but I just want to get this part working first.
After I start a search, and try to click off the search results, they remain. Nothing happens. I have googled over and over, looking at the jquery and javascript docs. I am not sure where I am wrong.