<body> <script type="text/javascript" language="javascript"> x=prompt('please enter any amount of money you want.','500000') if(x>=5) {alert('you are very greedy please enter any amount less then 5 go wild the sky is the limit') } else{document.write('congratz you won' + x) } </script> </body>
Now I want the document write function to say
congratz you won x dollars but I dont now how to do that if I do
(document.write('congratz you won' +x 'dollars') it does not work
also the alert box pops only once how do i get it to pop again some loop right because if the user continues to enter a number >5 he will have to continually try again
Please help this might be silly but its to learn at the end of the day
Question
damindor
so I have a few questions here is the script
<body>
<script type="text/javascript" language="javascript">
x=prompt('please enter any amount of money you want.','500000')
if(x>=5)
{alert('you are very greedy please enter any amount less then 5 go wild the sky is the limit')
}
else{document.write('congratz you won' + x)
}
</script>
</body>
Now I want the document write function to say
congratz you won x dollars but I dont now how to do that if I do
(document.write('congratz you won' +x 'dollars') it does not work
also the alert box pops only once how do i get it to pop again some loop right because if the user continues to enter a number >5 he will have to continually try again
Please help this might be silly but its to learn at the end of the day
Link to comment
Share on other sites
9 answers to this question
Recommended Posts