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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T01:54:57+00:00 2026-06-07T01:54:57+00:00

can somebody tell me what I am doing wrong? I am new to jquery

  • 0

can somebody tell me what I am doing wrong? I am new to jquery and I would like to have some feedback. Basically what I want is some sort of a countdown timer that would display how many days are left till an event happens. The event is a set date.

thank you for your help

 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

 <html xmlns="http://www.w3.org/1999/xhtml">

 <head>
 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
 <title>Almost Vacation</title>

 <script type="text/javascript"    src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>

 <script>
   $('document').on('ready', calc);
    function calc(){
        var myDate = new Date();
        myDate.setMonth(05, 06);
        var today = new Date();
        today.getDay();
        var x = myDate - today;
        $('#aantal p').text(x);
}



 </script>       

 <style type="text/css">
   p {
      color:red; 
      font-size:1.8em; 
      margin:-90px 10px 5px;
   }

 </style>

 </head>

 <body>

        <img src="http://fed.cmd.hro.nl/upload/files/1011/y1/q4/w3/slapende_student.jpg" width="462" height="275" />

    <p>Vacation starts in<span id="aantal">&nbsp;</span> Days</p>
 </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-06-07T01:55:00+00:00Added an answer on June 7, 2026 at 1:55 am

    It needs to be:

    $(function() {
        var myDate = new Date();
        myDate.setMonth(06, 06); //set date forward in time, not backward
        var today = new Date();
        var x = (myDate - today)/86400000;
        $('#aantal').text(x); //append to the span, not the p that does not exists
    });
    

    Fiddle

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

Sidebar

Related Questions

can somebody tell me what is jQuery plugin? I have used the jQuery library
Can somebody tell me what I am doing wrong over here, (Util.parseBoolean((String)request.getAttribute(testVal), false)) I
Can somebody tell me why this should be wrong? #Each new term in the
Can somebody tell me what I am doing wrong with the quiver plotting function
Can somebody check my code and tell me where I'm doing wrong. I'm very
Can somebody tell me what I am doing wrong really? I am going nuts,
We want to store product prices and weight (kg/pound) in MySQL. Can somebody tell
Can anybody tell me what I am doing wrong? The table that I am
Can somebody please tell me what || this doing here (function() { window.myapp =
Can somebody tell me what is the meaning of Installs: 100-500. What Google Play

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.