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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T02:32:35+00:00 2026-06-16T02:32:35+00:00

Hi i am using this code to show hide div on input focus here

  • 0

Hi i am using this code to show hide div on input focus

here is html please have a look @jsfiddle also

<div id="divone">
    <input class="url_field" />
</div>
<div id="first" class="content">
    First
    <input class="close" type="button" value="X"/>
</div>
<div id="last" class="content">
    Last
    <input class="close" type="button" value="X"/>
</div> 

Javascript snippet:

$(document).ready(function() {
    $(".url_field").focus(function() {
        $(this).next(".content").fadeout('slow').css('display', 'inline');
    });

    $('.url_field').focus(function() {
        $('.content').hide();
        $('#' + this.rel + '').show();
        return false;
    });
    $('.content input.close').click(function() {
        $(this).parent().hide();
    });
});

please help me, its not working

  • 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-16T02:32:37+00:00Added an answer on June 16, 2026 at 2:32 am
    $(document).ready(function() {
    
        $('.url_field').focus(function() {
            //$(this).next(".showdiv").fadout('slow').css('display', 'inline');  not sure what this does so commented it out
            $('.content').hide();
            $('#' + $(this).attr('rel')).show(); // you also don't have a rel on the input so this won't do anything
            return false;
        });
    
        $('.content input.close').click(function() {
            $(this).parent().hide();
        });
    });
    

    also you probably want your css to start with display block unless you are starting them hidden and then showing them – but then you need to add rel=”last” or rel=”first” to your input

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

Sidebar

Related Questions

Im using this code to show/hide a div: <a href=# class=show_hide>Show/hide</a> <div class=slidingDiv> My
I'm using this jquery code to show and hide divs on my page. As
I am using following code to show a spinning wheel: $(#loading) .hide() .ajaxStart(function(){ $(this).show();
Why does this code attempt to hide the div but then show it again?
Code: $(document).ready(function(){ $(.div).hide(); $(document).on('keypress paste', function() { $('form').focus(); $(.div).show(fast); }); }); Thanks to adeneo
After using this code to get my link to show me 3 database entrys
I'm currently using this code (per the codex) to show children on parent pages,
I am using this code in my website to show Google search results for
I am using this code to parse this date. It must show new date
I'm using this code for my web assignment: http://csstechniques.blogspot.sg/2007/05/super-simple-css-bars.html But how do I show

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.