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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T23:38:07+00:00 2026-05-24T23:38:07+00:00

I have a selected box with 5 values. I’m trying to fadeIn inputs of

  • 0

I have a selected box with 5 values. I’m trying to fadeIn inputs of what is selected in the box. For example: If input1 is selected, fade in input1 on click.

Here is what I’m trying to do:

$(document).ready(function(){
    $('.btn').click(function() {
               if($("#selectbox").value == 'Input1') {
            $(".input1").show();
        } else if($("#selectbox").value == 'Input2') {
            $(".input2").show();
        } else if($("#selectbox").value == 'Input3') {
            $(".input3").show();
        } else if($("#selectbox").value == 'Input4') {
            $(".input4").show();
        } else if($("#selectbox").value == 'Input5') {
            $(".input5").show();
        }
    }
});

And here is a NOT working fiddle:

http://jsfiddle.net/rzMHJ/

  • 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-24T23:38:07+00:00Added an answer on May 24, 2026 at 11:38 pm

    Your code have two errors and that’s why its not working.

    1. $("#selectbox").value should be $("#selectbox").val()
    2. you have not closed your click event with );

    Also its much better to use switch case in this example.

    Working Demo: http://jsfiddle.net/naveen/Zn2yy/

    Update (based on Nick Cravers comment)

    For this particular scenario you could simplify code a lot like this.
    Demo: http://jsfiddle.net/nick_craver/BWacA/

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

Sidebar

Related Questions

I have a list box that allows multiple values to be selected. Here is
I want the user to click the select box and when have selected any
So here's what I have. There's this dropdown box, with values, lets say A,
I have a select box with some values. How do I get the selected
I have a requirement for adding values selected in a select box to a
I have a function to get the values of the selected check-box from the
I have a form which has a Combo Box Control. I have selected the
After I have selected a range containing numerical values, I want to, via VBA,
have an array of values [1,2,4] representing the values of a multi-select box, how
I have a select box with the following values ( months of the year

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.