JavaScript Prompt Method Tutorial

Prompt() Method

The prompt() method displays a dialog box that prompts the visitor for input. A prompt box is often used if you want the user to input a value before entering a page.

Syntax

prompt(text, defaultText)

Example: 1

Counting from var a to b using the prompt method.

Example: 2

Write a table using the prompt method.

Example: 3

Create a calculator

Take Your Free Live Demo Class Now

We Will Call Back You Shortly

Enter Your DETAILS BELOW

We Will Send You the Course Fees Details In Below Number

Enter Your DETAILS BELOW

We Will Call Back You Shortly

Enter Your DETAILS BELOW

We Will Call Back You Shortly

Enter Your DETAILS BELOW

Enter Your DETAILS BELOW TO take

free demo class