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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T17:46:52+00:00 2026-06-05T17:46:52+00:00

I am trying to create a quick search function on the menu of my

  • 0

I am trying to create a quick search function on the menu of my website using jquery. The code is very simple, when a user clicks the “quick search” link that will be part of menu of every page, an input text field will appear and they can search for whatever they want quickly. My code works for one toggle, but not more. I have been trying to fix this for ever now and it is suppose to be simple so i’m frustrated. I was hoping someone on here can maybe help me figure this one out?

NOTE: My code works more than once, on jsfiddle, but not anywhere else. -_-

Markup

<a href="#"> Register</a>  |
    <a href="#">My Account</a>  |
    <span>
        <span id="quicksearch" style="cursor:pointer; color:blue;"><a href="#">Quick Search</a></span>
        <input id="quickbox" type="text" style="float:right; display:none; padding:2px 5px 3px 5px; border:2px solid #ddd; margin-left:-110px; position:absolute; margin-top:20px;"/>
    </span> 

JQuery

<script type="text/javascript">
$(document).ready(function(){
    $("#quicksearch").click(function(){          
        $("#quickbox").toggle();
    });
});
</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-06-05T17:46:54+00:00Added an answer on June 5, 2026 at 5:46 pm

    Your style is messed up.. Fix it and it should work. See DEMO: http://jsfiddle.net/ZAHsv/5/

    You can position using .top and .left from the quicksearch link.. see below,

    $(document).ready(function(){   
        $("#quicksearch").click(function(){
            var qsPos = $(this).position();
            $('#quickbox').css({
                 'position': 'absolute', 
                 'top': qsPos.top + 20, 
                 'left': qsPos.left
             }).toggle();
        });
    });
    

    DEMO: http://jsfiddle.net/ZAHsv/7/

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

Sidebar

Related Questions

I'm trying to create a quick and dirty simple menu that is generated by
I am trying to create a quick hashcode function for a complex number class
I am trying to create a simple visualization of what my code does. I
I'm trying to create a quick piece of code to capture the key sequence
I'm trying to create a quick ASP.NET MVC 3 application using the RC version
I am trying to use the googlecharts gem to create some quick charts. Here
I'm trying create a bot which automatically likes Facebook posts. Using Mechanize I can
Ok so I am trying create a login script, here I am using PHP5
I am trying to create a quick fix for a problem I am having.
I was trying to create a quick little script that would insert data into

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.