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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T16:02:21+00:00 2026-05-25T16:02:21+00:00

I am having an issue getting my div’s to show on select from the

  • 0

I am having an issue getting my div’s to show on select from the drop down menu, I am getting $ is not defined I have adjusted my code to not have duplicate ids. When I load the page it shows all 3 divs but as soon as I select an option from the drop down they all go and hide.

JS:

$(document).ready(function(){ 
    $('#requiredOption').change(function(){
        $('#newwebsiteDiv,#websiteredevelopmentDiv,#otherDiv').hide();
        $(this).find('option:selected').attr('id') + ('Div').show();
    });
});

HTML:

<!DOCTYPE html>
<head>
    <meta charset="utf-8">
    <title>Template 2011</title>
    <link rel="stylesheet" href="_assets/css/style.css">
</head>
    <body>
        <header>
            <div id="logo">Template Here</div>
                <nav>
                    <ul>
                        <li><a href="/">Home</a></li>
                        <li><a href="#">About Me</a></li>
                        <li><a href="quote.html">Free Quote</a></li>
                        <li><a href="#">Showcase</a></li>
                        <li><a href="#">Contact Me</a></li>
                    </ul>
                </nav>
        </header>
                        <section id="content">
            <h1>Free Quote</h1>
                <p>Please fill out the below questionnaire to receive your free web development quote</p>
                    <form action="" method="post" accept-charset="utf-8">
                        <select name="requiredOption" id="requiredOption">
                            <option id="pleaseselect" value="pleaseselect">Please Select Your Required Quote</option>
                            <option id="newwebsite" value="newwebsite">New Website</option>
                            <option id="websiteredevelopment" value="websiteredevelopment">Website Redevelopment</option>
                            <option id="other" value="other">Other</option>
                        </select>
                        <p><input type="submit" value="submit"></p>
                    </form>
                        <section id="newwebsiteDiv">
                            <p>New Website</p>
                        </section>
                            <section id="websiteredevelopmentDiv">
                                <p>Website Redevelopment</p>
                            </section>
                                <section id="otherDiv">
                                    <p>Other</p>
                                </section>

</section>
            <section id="sidebar">
        <div id="box_one">
            <p>Box One</p>
        </div>
        <div id="box_two">
            <p>Box Two</p>
        </div>
        <div id="box_three">
            <p>Box Three</p>
        </div>
        </section>      
            <footer>
                <p>This is the footer</p>
            </footer>
            <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js" type="text/javascript"></script>
            <script src="_assets/js/js.js" type="text/javascript"></script>
</body>
  • 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-25T16:02:22+00:00Added an answer on May 25, 2026 at 4:02 pm

    the jquery and js file import thing is ok;
    first,your code not include any element contains id “select”.your hide code should like ‘evan’

    $(‘#newwebsite,#websiteredevelopment,#other’).hide();
    so your code should like this:

    $(document).ready(function(){ 
        $('#requiredOption').change(function(){
            $('#newwebsiteDiv,#websiteredevelopmentDiv,#otherDiv').hide();
            var targetDiv=$(this).find('option:selected').attr("id")+"Div"
            $("#"+targetDiv).show();
        });
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Im having an issue with a drop down menu in IE only and Im
I'm having an issue getting a LINQ query to work. I have this XML:
Im having issues getting this to work, maybe its not even possible? I have
So im having a little issue getting my menu with a slidedown function work
I have an issue with having a asp.net Grid View loaded into a div
I'm having an issue getting some code to work. Is there a way to
I'm having an issue getting files loaded into an app called GCS, by dragging
I'm having an issue getting this CSS for a sprite sheet to work on
I'm having an issue getting Appstats to work correctly. Using /appstats or /appstats/stats ends
I am getting into C# and I am having this issue: namespace MyDataLayer {

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.