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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T08:09:19+00:00 2026-05-29T08:09:19+00:00

I have a div with an id called #wrapper . Next to it I

  • 0

I have a div with an id called #wrapper. Next to it I have button. When the button is clicked, an ajax call is triggered returning a list of divs with a class called .calendarDate. Everything works great, #wrapper is populated fine.

Now I am trying to have a click event on that .calendarDate class, but it is not working. The strange part is that the CSS properties I apply to that class are working properly. Hope someone can acknowledge about that strange behavior. By he way, no errors in my debugger. Thank you in advance for your replies. Cheers. Marc

My PHP: working great

Here i set my variables...

while($input<$inDays){
    ++$input;
    $test=$input." days";
    if($input<0){$attribut='"avant"';}else{$attribut='"apres"';}
    echo '<div class="calendarDate" indiDate=' .$attribut. '>' .date('Y-m-d', strtotime($test)). '</div>';
}

My JS:

$(document).ready(function() {
$('#wrapper').load('php/calendar2.php');
$('.calendarDate').click(function(){
        alert('Whaou!');
    });
});

My HTML:

<div id="wrapper"></div>
        <input id="envoyer" type="submit" multiplicateur="1">
  • 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-29T08:09:20+00:00Added an answer on May 29, 2026 at 8:09 am

    It sounds like you’re binding the click event to the calendarDate class before it exists. Try using this to bind the event handler instead…

    $(document).on("click", ".calendarDate", function() {
        // etc
    }
    

    That will fire the click event handler to all elements with a class of calendarDate, regardless of whether they exist at document ready or not.

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

Sidebar

Related Questions

I have div class called .stage which is a stage of a questionnaire <div
I have a div called #devices and I use ajax to populate it, but
I have a DIV Called fArea and when i click the open button it's
I have a div called test and mvc action in the client controller The
I've got 3 tabs. Each of them have a div called optional , apart
I have div containing a list of flash objects. The list is long so
I have a div with two nested divs inside, the (float:left) one is the
I have a Div with five float divs inside: var div=document.createElement(div); div.className=cssDivNino; var divFolio=document.createElement(div);
I have a div called appHeader... and the content of it is subject to
I have a div called 'divLinks' I want all links inside the divLinks to

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.