Javascript Prompt

What is prompt method?


In this article we are goanna to see about what is prompt method in JavaScript. which is most important when you are going to start your career in JavaScript. Please read and enjoy this article if you want to give any feedback about your experience, we welcome.

prompt() – The browser provides a built-in function which can be used to get input from the user, name prompt.




The prompt() method displays a dialog box that prompts the visitor for input.

Once the prompt function obtains input from the user, it return that input.

Syntax : prompt(text, defaultText)

Ex: 

prompt(“Enter Your name: “,”name”);
prompt(“Enter Your Roll No. : “);




Share:

0 comments

Please leave your comments...... Thanks