Question: QUICK JAVASCRIPT QUESTION. Hello, I am making a program ins Java script that subtracts a date from the current date and outputs how many days

QUICK JAVASCRIPT QUESTION.

Hello, I am making a program ins Java script that subtracts a date from the current date and outputs how many days you have lived, but it is not printing out in my HTML page.

here is the code:

HTML CODE:

Date and Time Methods

Todays Date and Time Is:

The Birthdate You Entered Is:

You Have Lived For:

JAVASCRIPT CODE:

 function start() { n = new Date(); y = n.getFullYear(); m = n.getMonth() + 1; d = n.getDate(); document.getElementById("currentDate").innerHTML = m + "/" + d + "/" + y; return[y, m, d] } function middle() { b = new Date(); mString = window.prompt("Enter Month You Were Born (1-12): "); dString = window.prompt("Enter Day You Were Born (1-31): "); yString = window.prompt("Enter The FULL Year You Were Born: "); m = parseInt(mString); d = parseInt(dString); y = parseInt(yString); document.getElementById("birthdate").innerHTML = m + "/" + d + "/" + y; return [y, m, d] } 

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!