Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7510275
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T23:10:58+00:00 2026-05-29T23:10:58+00:00

I have a Jquery Autocomplete menu with an image at the bottom of it

  • 0

I have a Jquery Autocomplete menu with an image at the bottom of it – added with the code below.

Is there a way to have Jquery Autocomplete menu close (disappear) after I click on the picture?

Thank you for your help.

<script>
$(function() {
       var availableTags = [
        "new york, ny",
        "new york city, ny",
        "manhattan, ny",
        "queens, ny",
        "brooklyn, ny",
        "bronx, ny",
        "staten island, ny",
        "kings county, ny",
        "richmond county, ny",
        "big apple, ny" 
    ];
    $( "#tags" ).autocomplete({ 
        source: availableTags,
        open: function (event, ui) { 
                     var nyc="<img src=\"images/iloveny.jpg\" onclick=\"DoGood()\"/>";
                     $(this).autocomplete("widget").append(nyc); 
            },
    });
}); 
</script> 
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T23:11:01+00:00Added an answer on May 29, 2026 at 11:11 pm

    On the click event, call $( "#tags" ).autocomplete( "close" );.

    Here is how I’d do it…

    $("#tags").autocomplete({
        source: availableTags,
        open: function(event, ui) {
    
            var nyc = $("<img />", {
                src: "http://www.gravatar.com/avatar/8a3efc8be996c87da020df31e2416151?s=32&d=identicon&r=PG",
                alt: ""
            });
    
            nyc.click(function() {
                $(event.target).autocomplete("close");
            });
    
            $(this).autocomplete("widget").append(nyc);
        }
    });​
    

    jsFiddle.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

The below code is very simple. I have a jQuery autocomplete bound to an
I want to have jquery-ui autocomplete automatically select the answer if there is only
I've recently added the JQuery autocomplete plug in and have a textbox that autocompletes
I have a jquery's autocomplete texbox and, upon a click of a button, I
I have a Jquery autocomplete ajax function whose source is calculated from code behind.
I have a jQuery autocomplete box with relatively and absolutely placed items below it.
I have a jquery autocomplete textbox. http://docs.jquery.com/UI/Autocomplete#events The spec there shows this: Triggered when
I have a jQuery autocomplete field with this code: var tags = [a, ab,
I have a Jquery UI autocomplete code that grabs data from an ajax request,
I have a jQuery Autocomplete field on an ASP.Net Webform and everything has been

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.