I need ti write an interactive web page using JavaScript that will ask the user his/her month, day and year of birth (in separate prompt boxes) and displays his/her date of birth (using the month name, not number) and current age in a dialog box.
ok i have done some work but now iam stuck i don't know what to do next can some one give me a hint.
CODE
<html>
<head>
<title>Project</title>
<script type="text/javascript">
</script>
</head>
<body>
<script type="text/javascript">
var birthMonth = parseInt(prompt("Please enter the month of your birth"));
var birthDate = parseInt(prompt("Please enter the date of your birth"));
var birthYear = parseInt(prompt("Please enter the year of your birth"));
var today = new Date()
var month = today.getMonth()
var monthText
if(month==0)
monthText="January"
else
if(month==1)
monthText="February"
else
if(month==2)
monthText="March"
else
if(month==3)
monthText="April"
else
if(month==4)
monthText="May"
else
if(month==5)
monthText="June"
else
if(month==6)
monthText="July"
else
if(month==7)
monthText="August"
else
if(month==8)
monthText="September"
else
if(month==9)
monthText="October"
else
if(month==10)
monthText="November"
else
monthText="December"
var date = today.getDate()
var year = today.getFullYear()
var day = today.getDay()
var dayText
if(day==0)
dayText="Sunday"
else
if(day==1)
dayText="Monday"
else
if(day==2)
dayText="Tuesday"
else
if(day==3)
dayText="Wednesday"
else
if(day==4)
dayText="Thursday"
else
if(day==5)
dayText="Friday"
else
dayText="Saturday"
</script>
</body>
</html>