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

  • Home
  • SEARCH
  • 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 6840801
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T23:53:18+00:00 2026-05-26T23:53:18+00:00

Hi everyone I’ve been looking for a simple example on how to make an

  • 0

Hi everyone I’ve been looking for a simple example on how to make an html select appear like a combobox. I found a sample code snippet from this link. Its actually an answer to a question similar to mine. Its answered by Samich. It has a jsfiddle link. I copied the code from jsfiddle and tweaked it a little bit to make it run on my machine but I can’t make it run.

Here is the code (Most of the codes are written by Samich):

<html>
    <head>
        <style type="text/css">
            #dropdown { position:absolute; width:200px; display:none; }
            #dropdown li:hover { background:#ccc; cursor:pointer; }
        </style>
        <script type="text/javascript" src="jquery1.6.4min.js"></script>
        <script type="text/javascript" > 
            $('#btn').click(function() {
                var pos = $('#txt').offset();
                pos.top += $('#txt').width();
                $('#dropdown').fadeIn(100);
                return false;
            });

            $('#dropdown li').click(function() {
                $('#txt').val($(this).text());
                $(this).parent().fadeOut(100);
            });
        </script>
    </head>

    <body>
        <input type="text" id="txt" /><a href="#" id="btn">V</a>
        <ul id="dropdown">
            <li>Value 1</li>
            <li>Value 2</li>
            <li>Value 3</li>
            <li>Value 4</li>
            <li>Value 5</li>
            <li>Value 6</li>
            <li>Value 7</li>
            <li>Value 8</li>
            <li>Value 9</li>
            <li>Value 10</li>
            <li>Value 11</li>
            <li>Value 12</li>
        </ul>
    </body>
</html>

I am very new to javascript and jquery so please bear with me guys. Thanks a lot in advance.

  • 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-26T23:53:18+00:00Added an answer on May 26, 2026 at 11:53 pm
    <script type="text/javascript">
    $(document).ready(function() { 
      $('#btn').click(function() {
        var pos = $('#txt').offset();
        pos.top += $('#txt').width();
    
        $('#dropdown').fadeIn(100);
    
        return false;
      });
    
      $('#dropdown li').click(function() {
        $('#txt').val($(this).text());
        $(this).parent().fadeOut(100);
      });
    });
    </script>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

everyone.I wanna include javascript in the html(webpy templates),but it doesn't work.the javascript code in
Everyone uses source-code control to manage versions (right?) and this provides some level of
everyone I got a question , I want to implement a UI , Like
everyone. I'm new here and this is my first post. I'm creating a simple
everyone, I have this piece of the code: void foo(int var, int var1) {
everyone! I've been at this for a while, and I'm not sure how this
Everyone knows? about avatar url in tumblr api / read / json? like for
everyone! I couldn't find a tutorial explaining the right way to code this. I
Everyone has been a super help so far. My next question is what is
everyone, I have problems when using MVC3 code is as follows public SystemController(IRepository repository)

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.