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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T06:13:42+00:00 2026-06-08T06:13:42+00:00

In jQuery, you can stop a <select> from opening it’s dropdown menu by using

  • 0

In jQuery, you can stop a <select> from opening it’s dropdown menu by using event.preventDefault in the mousedown handler. Allowing you to replace the dropdown with something else while still retaining the original style of the form element.

This works fine in Chrome and MSIE, but in FireFox and Opera the dropdown appears regardless.
(Not tested on Safari)

Example: http://jsfiddle.net/9cmEh/

The select element should look enabled and still respond to all user interaction as if enabled, but the dropdown should not be rendered. Instead the dropdown will be replaced by something custom rendered, such as including color swatches, icons or fonts, but the “custom dropdown” part is already done in my project.

Does anybody know how to make this work in all* browsers.

  • “All” meaning the recent versions of the five browsers mentioned.
  • 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-08T06:13:44+00:00Added an answer on June 8, 2026 at 6:13 am
    $(function() {
        $('select').on('focus', function(e) {
            this.blur();
            window.focus();
        });
    });
    

    FIDDLE

    Works in Firefox atleast, but does’nt seem to work in Chrome ?

    EDIT

    I could’nt come up with a decent way of detecting whether one method works or not, so did some browser sniffing instead. Not really the best way to do it, but the best I could come up with, and it does seem to work in the browsers I’ve tested :

    $(function() {
        $('select').on('focus mousedown', function(e) {
            if ($.browser.webkit||$.browser.msie) {
                e.preventDefault();
            }else{
                this.blur();
                window.focus();
            }
        });
    });​
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

How can i stop propagation for link? <script src=http://code.jquery.com/jquery.min.js></script> <script> $(function() { $(#g).click(function(event){ alert(Link
JS library like JQuery can be linked directly from other site (e.g. google). Usually
i was wondering if jquery can be used to manipulate my select html element
I am using the rather fantastic jQuery multiple select plugin, ASM select This plugin
I am using jQuery and the widget Selectable to let my user select files
I am using jQuery 1.3.2, and I'm trying to select some elements in an
I'm writing a simple dropdown menu with jQuery and each item has a checkbox.
JQuery - Can we capture both the p and div tags at a time
I found jquery can generate file tree structure based on existing folders and files
I'm looking for something similar to this: Active navigation with jQuery - can't apply

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.