Home Articles FAQs XREF Games Software Instant Books BBS About FOLDOC RFCs Feedback Sitemap
irt.Org
#

Q277 How do I capture what the user entered when using prompt()?

You are here: irt.org | FAQ | JavaScript | Misc | Q277 [ previous next ]

The prompt method *returns* the value, all you need to do is use what is returned:

var text = prompt('Enter some text');

or

alert(prompt('Enter some text'));

©2018 Martin Webb