answersLogoWhite

0


Best Answer

alert() function display the message to the user with OK button. Pressing 'OK' button will close the pop up message box.

Example: Please enter your name.

confirm() function will display the message to user with OK and CANCEL button .Pressing OK return 'true' to js script where as pressing CANCEL button return 'false' to js script.

confirm() function is mostly used to collect the user's input also.

Example: Are you willing proceed?

User Avatar

Wiki User

12y ago
This answer is:
User Avatar
More answers
User Avatar

Wiki User

10y ago

Confirm

A confirm box is often used if you want the user to verify or accept something. When a confirm box pops up, the user will have to click either "OK" or "Cancel" to proceed. If the user clicks "OK", the box returns true. If the user clicks "Cancel", the box returns false.

Prompt

A prompt box is often used if you want the user to input a value before entering a page. When a prompt box pops up, the user will have to click either "OK" or "Cancel" to proceed after entering an input value. If the user clicks "OK" the box returns the input value. If the user clicks "Cancel" the box returns null.

Source:

http://www.w3schools.com/js/js_popup.asp

This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Difference between alert number javascript
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

How do you get the popup javascript box?

Use confirm or alert in javascript code to get a popup


What is embedding java script?

To embed JavaScript code is to include it in the HTML page. For example, this will embed the code to display an alert: <script type="text/javascript"> alert("Embedded alert!"); </script>


Write a JavaScript program showing string concatenation?

There isn't much to it:---alert("Hello " + "world!");---'alert' creates a popup, and the + does string concatenation.See related link for a Javascript tutorial.


Which javascript function is most useful for finding erro?

Alert


What is the code for JavaScript?

JavaScript code looks like this:function sayhi(name) {alert("Hey there, "+name);}sayhi("joe");


What is the difference between observant and observative?

watchful and alert.


How do you round the number 7.25 to the nearest integer in javascript?

with parseInt. EX: xxx=7.25; a=parseInt(xxx); alert(a);


What is the code for finding the power of a numberon a JavaScript?

The JavaScript code for raising a number to a particular power is part of the Math object. Math.pow() takes 2 arguments. The first is the base value that you which to take to an exponent. The second in the exponent.So, Math.pow(2, 10) = 210 = 1024In JavaScript, you'd want to capture this value as a variable.var ourVal = Math.pow(2, 3);alert (ourVal); //will alert "8"


What are some simple JavaScript programs a total newbie could create?

Personally, I recommend you begin with 'alert' boxes and 'prompt' boxes, then move your way up to variables, until eventually you understand functions, arrays, etc. Then you will be able to create JavaScript masterpieces. You may also want to learn php once you've mastered JavaScript. Simple alert example: Lesson 1: alert boxes alert("This is an alert dialog box."); Body text. Have fun!


What types of javascript alert boxes are there?

many, tell me which one you need and i will give you it,


What JavaScript method is most commonly used to generate output?

alert and prompt


Example of predefined function?

function callMe (fx_params) { alert(fx_params); } callMe('Alert Loaded from a JavaScript function'); This would be in a javascript page, or in a JS Script tag.. - Caleb Convina Web Design and Hosting