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

  • Home
  • SEARCH
  • 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 8932803
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T09:23:30+00:00 2026-06-15T09:23:30+00:00

These select options are changed via a wordpress backend, as well as the following

  • 0

These select options are changed via a wordpress backend, as well as the following div tags.

What I need is for the corresponding div tag to show only when the select box is on that choice by what number child it is.

Example of code:

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

<ul id="show-these">
    <li></li>
    <li>Happy huh?</li>
    <li>Why so sad?</li>
    <li>Everything will be ok!</li>
    <li>Cheer up!</li>​​​​​​​​​​​​​​​​​​​​​​​​
</ul>

So basically I would like jquery to be able to know which number child is selected and show the same number child in the li ID “show-these”.

  • 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-15T09:23:31+00:00Added an answer on June 15, 2026 at 9:23 am

    JS

    var $ul = $('#show-these');
    $ul.find('li').hide();
    
    $('.select').on('change', function(){
        var index = $(this).find('option:selected').index();
        var $ul = $('#show-these');
        $ul.find('li').hide();
        $ul.find('li').eq(index).show();
    
    });​
    

    HTML

    <div id="show-these">
        <li></li>
        <li>Happy huh?</li>
        <li>Why so sad?</li>
        <li>Everything will be ok!</li>
        <li>Cheer up!</li>​​​​​​​​​​​​​​​​​​​​​​​​
    </div>
    

    Check Fiddle

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

Sidebar

Related Questions

I have these 2 statements: $pow= mysql_query(select options.label from options where userid='1'); and: $sql=(SELECT
There are too many options for creating projects in XCode, But When we select
I have two select fields in a form. Every time one of these select
How do I combine these two select statements into one query: SELECT SUM( incidents
Given these two queries: Select t1.id, t2.companyName from table1 t1 INNER JOIN table2 t2
Got these 2 queries: select d1.field_id_41 program_code, d1.field_id_48 program_group_code, t1.title program_lookup, t2.title group_title, t1.url_title
Consider the following HTML: <select> <option value=hasAttr>Has a value attr</option> <option>Does not have a
I'm receiving the following error on this line of code select.up().appendChild(sw); With error SCRIPT438:
Is there a style for a select option's selected color? For example: <HTML> <BODY>
Is there any possibility to select a option field by default in a g:select

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.