Try:<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>