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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T00:20:43+00:00 2026-05-24T00:20:43+00:00

Simple enough, I hope. I’m trying to get a div to fadeIn when I

  • 0

Simple enough, I hope. I’m trying to get a div to fadeIn when I click on a date in jQuery’s datepicker:

<!DOCTYPE html>
<html>
<head>
  <link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery-ui.css" rel="stylesheet" type="text/css"/>
  <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js"></script>
  <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js"></script>
  <script type="text/javascript" src="../datepicker/jquery.ui.core.js"></script>
  <script type="text/javascript" src="../datepicker/jquery.ui.widget.js"></script>
  <script type="text/javascript" src="../datepicker/jquery.ui.datepicker.js"></script>

  <script>
  $(document).ready(function() {
    $('#datepicker').datepicker();
    $('#datepicker').datepicker({
        onSelect: function(dateText, inst) {
        $('#foo').fadeIn();
        });
    });
  });
  </script>
</head>
<body style="font-size:62.5%;">

<p>Choose a date: <input id="datepicker" type="text"></p>

<div id="foo">FOO</div>

</body>
</html>
  • 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-24T00:20:45+00:00Added an answer on May 24, 2026 at 12:20 am

    1. Your code has an extra parentheses and a semi-colon, see the comment on the code below:

    $(document).ready(function() {
        $('#datepicker').datepicker();
        $('#datepicker').datepicker({
            onSelect: function(dateText, inst) {
            $('#foo').fadeIn();
            }); // <-- HERE, it should be just }
        });
    });
    

    This is the correct code:

    $(document).ready(function() {
        $('#datepicker').datepicker({
            onSelect: function(dateText, inst) {
                $('#foo').fadeIn();
            }
        });
    });
    

    2. There is no need to attach the datepicker() twice to the same element, you just assign it once, with the appropriate parameters, hence why I removed the extra $('#datepicker').datepicker().

    3. You should hide the element in order for it to remain hidden until you fade it in. Use this CSS:

    #foo{
        display: none;
    }
    

    Check a demo here »

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

Sidebar

Related Questions

Simple enough question I hope. I am using the following type of code to
Very inexperienced with Flash, but I hope this is simple enough for someone to
This is my first question here and I hope it is simple enough to
I'm been grinding my head against an idea that is simple enough in my
I hope my question will be clear and perfect enough to not get down
I hope this is a simple enough question for any SQL people out there...
I thought that this would be simple enough, but I just can't get my
I am trying to rename a button from a string. Sounds simple enough? Well
Simple enough situation. I've got a MongoDB database with a bunch of information from
Simple enough question. What is the 'aspx' or 'ascx' page called? I need the

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.