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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T01:38:31+00:00 2026-05-16T01:38:31+00:00

I have two <div> elements: <div id=hidden> <div id=hideitem> <input id=item5 type=radio class=item name=item

  • 0

I have two <div> elements:

<div id="hidden"> 

<div id="hideitem">
<input id="item5" type="radio" class="item" name="item" value="gen"/>General Function
</div>

I set <div id="hidden"> to display:none. I want it to show when the radio button is clicked:

$("#item5").click(function() {
    $("#hidden").show();
}

But how can I hide <div id="hideitem"> after <div id="hidden"> is shown?

  • 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-16T01:38:31+00:00Added an answer on May 16, 2026 at 1:38 am

    Like most jQuery fx methods, .show() has a optional parameter where you can serve a callback function. The function you pass there is executed after the fx effect has finished.

    $('#hidden').show('fast', function(){
       $('#hideitem').hide();
    });
    

    That would pass an anonymous function as parameter, which is called after the effect. It just hides the #hideitem object then.
    You’ll notice that I’ve added an additional parameter 'fast'. That is the duration jQuery uses to execute the fadeout (can also be a number in ms). It really only makes sense to use it like this, because otherwise, .show() will just set the display property to block. Without a duration we have no delay. So a callback function for that would get invoked immediately.

    If you want to show and hide that elements simultaneously just call both

    $('#hidden').show();
    $('#hideitem').hide();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have two elements: <input a> <input b onclick=...> When b is clicked, I
I'm trying to have two or more columns worth of DIVs for input elements
I have two elements: 1. A parent of fixed height, overflow:hidden 2. Its child,
I have two divs like so <div id=parent style=width:100px:overflow:hidden;> <div id=child> tooooooooooooooooooooo much content
I have a div with two nested divs inside, the (float:left) one is the
I have a container div that holds two internal divs; both should take 100%
I have a list with two <div> s in every <li> and I want
I have two classes, and want to include a static instance of one class
I have some page elements which are meant to appear in a two column
I have two divs. One of them contains an input field the other a

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.