We have already talked about alert messages but today we will se how to create a prompt boxes and use the data used in prompt box into alert messages to create a welcome message for any user coming on our web page.
So let's get started...! It will going to an easy one today.
Step 1 : create a html structure just like all the other tutorials.
Step 2 : Create following script tag and write the code as it is. This is infinite loop using for loops.
Step 3 : Run your html file with a browser and then see the result.
Step 4 : Write your user name here for example if i write @sct.blurt.
Step 5 : Welcome message will be printed for @sct.blurt.
Full Code :
Prompt is a predefined function in Javascript that is used to prompt a message box on the screen.
Ask Your doubts in the comments below
Thank You...!
Links to all the tutorials are shared below
- Javascript , Alert Message
- Lets Play with buttons Using Javascript
- How To Change Html content using Javascript
- Data Types And Variable in Javascript #1
- SWAPPING TECHNIQUE IN JAVASCRIPT
- OBJECTS IN JAVASCRIPT #1
- OBJECTS IN JAVASCRIPT #2
- OBJECTS IN JAVASCRIPT #3
- ARRAYS IN JAVASCRIPT #1
- If and Else Statements in Javascript
- FOR LOOPS IN JAVASCRIPT
- FOR LOOPS WITH IF and ELSE
- ERRORS IN JAVASCRIPT
- WHILE LOOPS IN JAVASCRIPT
- INFINITE LOOPS in JS