• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 375
  • Last Modified:

how old are you

     Hallo,
      
      
      
      the code should give how old someone is but it doesent work i have done everything i know
      
      Thanks
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
		<title>Ahmadi Mohsen oefening 3</title>
	</head>
	<body>
		
		<script type="text/javascript">
		name = prompt("your last name");
		
		document.write( "Welkom " + name );
        </script>
		
		<script type="text/javascript">
		fname = prompt("your first name");
		yeardate = parseInt (prompt("geef uw geboortedatum"));
		year= 2010-yeardate
		alert(fname + " you are " + year + " years!"  );
		
		
		</script>

	</body>
	

</html>

Open in new window

0
kensy11
Asked:
kensy11
1 Solution
 
aboo_sCommented:
Well I tried your code and it told how old I am !

What seems to be the problem!?
0
 
Gurvinder Pal SinghCommented:
i am getting the correct output here

Which browser are you trying with and what is the expected output?
0
 
kensy11Author Commented:
ooh im sorry i got it wrong but thanks
0
 
for_yanCommented:
It actually works.
I copied it into file with .html extension (attachemnt)
if you open it in
the browser (or just save it and double-click on your PC) it asks name, last name and age and then determines
the date of birth
try.html
0
 
aboo_sCommented:
This guy had me check his code and confirm it's working and then just take off with no points awarded!

This does not look too good!
0

Featured Post

Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now