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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T09:57:32+00:00 2026-05-26T09:57:32+00:00

I have a Drop down box Based on the selection i should populate the

  • 0

I have a Drop down box Based on the selection i should populate the content specific to that year. At any time i can only populate one year content and i need to hide the rest of content based on the selection. How should i code this using Jquery

<div style="margin:4px 0 0 0;">
          <label> Select Year </label>
            <select name="select_Release">
                <option value="2011">2011</option>
                <option value="2010">2010</option>
                <option value="2009">2009</option>
                <option value="2008">2008</option>
                <option value="2007">2007</option>
                <option value="2006">2006</option>
                <option value="2005">2005</option>
            </select>
      </div>

<div>Some 2011 content  to display</div>
<div>Some 2010 content  to display</div>
<div>Some 2009 content  to display</div>
<div>Some 2008 content  to display</div>
<div>Some 2007 content  to display</div>
<div>Some 2006 content  to display</div>
<div>Some 2005 content  to display</div>
  • 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-26T09:57:33+00:00Added an answer on May 26, 2026 at 9:57 am

    Working example here: http://jsfiddle.net/FDpmb/1/

    jQuery:

    //traverse the DOM once to get all of your div tags per year
    var years = $('.options > div')
    //define a function that will show/hide the year content
    var check = function($select)
    {
        var year = $select.val();
        years.hide();
        $('div[data-year="' + year + '"]').show();
    }
    //get the instance of your select box
    var element = $('#select_Release');
    //bind an event handler
    element.change(function () { check($(this)); });
    //and we want to show the correct content initially, so call our change function
    check(element);
    

    Slightly modified markup (Note the id on your select box, and the extra div tag and data-year attributes):

    <div style="margin:4px 0 0 0;">
        <label> Select Year </label>
        <select id="select_Release" name="select_Release">
            <option value="2011">2011</option>
            <option value="2010">2010</option>
            <option value="2009">2009</option>
            <option value="2008">2008</option>
            <option value="2007">2007</option>
            <option value="2006">2006</option>
            <option value="2005">2005</option>
        </select>
    </div>
    <div class="options">
        <div data-year="2011">Some 2011 content  to display</div>
        <div data-year="2010">Some 2010 content  to display</div>
        <div data-year="2009">Some 2009 content  to display</div>
        <div data-year="2008">Some 2008 content  to display</div>
        <div data-year="2007">Some 2007 content  to display</div>
        <div data-year="2006">Some 2006 content  to display</div>
        <div data-year="2005">Some 2005 content  to display</div>
    </div> 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a drop down box and some text input fields below it. Based
I have a continuous form that contains a drop down box whos control source
I have a drop down that filters a multi-select box that then the user
I have a drop down box for each row inside a table <table> <tr>
On my page I have a drop-down select box, with a default value of
I have a select box that should be populated only when clicked. The query
So I have a drop-down list and a text-box: <table> <tr> <td>Group Name: </td>
I'm tyring to use AJAX to populate a dropdown box based on the selection
I have an html table of data with a drop down box in each
I have three values I need to align in a dropdown box. How can

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.