prompt() is used for retrieving infomration from the user. prompt() will cause a box to pop up that has an area for users to enter information. The first string parameter (what's in the parentheses) will be the question and the second is a default answer. You may omit the second parameter (and the comma) if you don't need a default answer. If you don't need the user to respond then use alert().
Examples:
The code:
<script type="text/javascript"> alert('Reload the page "F5" to run scripts'); var echo=prompt('What do you want echoed back to you?','echo'); alert(echo); alert(echo); alert(echo); </script>
<script type="text/javascript"> var x=prompt('What is 2+2?') if(x=='4') { alert('Wow, I bet you thought that was hard.'); } else{ alert('My 6 year old neice is better than you! Ha!') } </script>
<button onclick="this.innerHTML=prompt('what should I say?','text changed')"> change my text </button>