I was making a simple code that you put the year you were born and it gives you your age; but it didn't work. Can you please tell me where am I wrong?Thanks.Here is the code:
<html><head><script type="text/javascript">function disp_prompt() { var year=prompt("Please write the year you were born","1950") var age=2006-year { document.write("Hello, you are" + age + "years old"!) } }</script></head><body><input type="button" onclick="disp_prompt()" value="Click here" /></body></html>