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 8815723
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T04:26:55+00:00 2026-06-14T04:26:55+00:00

I am trying to make a dropdown combobox (didnt want to try JQuery plugins

  • 0

I am trying to make a dropdown combobox (didnt want to try JQuery plugins this one time).

This is my HTML:

<div style="display: table-cell; width:150px; z-index:-1;" id="supdiv">
        <input size='10' id='supinput'>
            <div id='supsel' style='position:absolute;z-index:0;background-color:#b0c4de;'>
            <input type ='checkbox' value='0' id = 'supplier[]' name='supplier'>A</br>
            <input type ='checkbox' value='1' id = 'supplier[]' name='supplier'>A</br>
            <input type ='checkbox' value='2' id = 'supplier[]' name='supplier'>A</br>
            <input type ='checkbox' value='3' id = 'supplier[]' name='supplier'>A</br>

            <input type='button' value='OK' id='supclose'>
            </div>
</div>

When the page loads, I hide the supsel div.

$('#supsel').hide();

I show the div when the focus comes to supinput. Also, I hide the div when OK button is clicked.

$('#supinput').focus(function(){
            $('#supsel').show()
    }); 
 $('#supclose').click(function(){
            $('#supsel').hide()
    });

Now my problem is, I want to hide the div if the user clicks anywhere else on the page or the focus is moved to any other input or area, But i want the div to keep showing till the time the user is selecting the checkboxes or the focus is on SUPSEL. How do i do that?

  • 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-06-14T04:26:56+00:00Added an answer on June 14, 2026 at 4:26 am

    jsBin demo

    </br> shoud be <br />
    and <input> should be <input />

    than just add:

    $('#supdiv').on('click',function(e){
        e.stopPropagation(); // prevent clicks on your parent div to propagate to doc.
    });
    $(document).on('click focusout',function(event){   // register clicks focusouts
      if(event.target.id !== 'supdiv'){  // if click was not on your parent bropbox
        $('#supsel').hide();             // than do something about it! ;)
      }  
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to make a quick CSS style switcher from a dropdown in HTML.
I am trying to make a 'dropdown' menu style of which its a div.
I'm trying to make a navigation dropdown with jQuery that looks like this: <ul
I am trying to make a dropdown menu with pure html and css, but
I'm trying to make a dropdown suggestion box using jQuery. I have a function
i am trying to implement jquery's toggle method to make a dropdown menu, it
I'm new to jquery and i'm trying to make a dropdown menu list like
I'm trying to make a CSS & JS based dropdown-menu. This example works in
I am trying to make dropdown enabling using jquery and click search then that
I'm trying to make a CSS/javascript dropdown menu (based on this example . This

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.