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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T16:14:01+00:00 2026-06-06T16:14:01+00:00

I am terrible at Jquery, and can barely understand it as I try to

  • 0

I am terrible at Jquery, and can barely understand it as I try to make this code for my site.

My goal is to have Div tags appear when the value that is selected in a form equals that Div tag’s name.

Here is what I have:

<form>
    <select name="SELECT_Mood_30">
        <option value="hap">Happy</option>
        <option value="sad">Sadness</option>
        <option value="ang">Angry</option>
        <option value="gru">Grumpy</option>
    </select>

    <select name="SELECT_hair_75">
        <option value="red">red</option>
        <option value="bla">black</option>
        <option value="blo">blonde</option>
        <option value="bru">brunette</option>
    </select>
</form>

Now imagine there’s maybe 40, 50, or even 100 different options. Each with a hidden div like below. Upon selecting the option with a value that matches the name of one of these divs, I want the div to appear. When deselecting it I want it to disappear.

<div id="ang" style="display:none;">
    SO YOU'RE ANGRY HUH?!
</div>
<div id="sad" style="display:none;">
    How can I make you feel better?
</div>
<div id="bla" style="display:none;">
    Black hair is really cool
</div>
<div id="red" style="display:none;">
    Red hair is nice!
</div>

Is it possible in Jquery to make this? Possibly make it look up the value that is selected, then unhide the named div. The name of the form doesn’t matter, it could look up the color red in the mood form and if it appears it could display it anyway. If the named div doesn’t exist, then nothing happens and all is good? (no error message or anything)

I’ve found a few working ones online, but they all seem to require to put each option inside the Jquery, which is what I don’t want. I would like it to be flexible enough where you simply have to change the option values and the div names.

Edit: I forgot to mention that say if one select is chosen, such as “sad”, and then someone chooses “red”, I don’t want the div that was named “sad” to disappear. but if the “ang” option is selected, I want the “sad” to disappear. I hope that doesn’t confuse things a lot more.

  • 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-06T16:14:03+00:00Added an answer on June 6, 2026 at 4:14 pm

    Add a class to all of your div

    $("select").change(
    function()
    {
    $(".class").hide();
    $(".class[id='"+this.value+"']").show();
    })
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am having a terrible time figuring this one out. I have a form.
On IE I can do this with the (terribly non-standard, but working) jQuery if
I've written some jquery to solve this problem. Although it works, I can't help
i am using jquery library in my project.I have terrible problem with jquery tabs.Solutions
I'm using this terrible API for a client. It packages HTML/JS to an iPad
I'm having terrible trouble trying to understand python scoping rules. With the following script:
I'm terrible at javascript and css, but I did manage to implement the Jquery
I've just noticed that something terrible is missing in jquery-ui. A way to rotate
Basically, I have a string like this: text text text text text 1/12/2012 text
Sorry for how stupid this is going to sound. My JS vocabulary is terrible

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.