How to display Alert in JavaScript

Answer Posted / veerahema

<!DOCTYPE html>
<html>
<body>

<h1>The Window Object</h1>
<h2>The alert() Method</h2>

<p>Click the button to display an alert box.</p>

<button onclick="myFunction()">Try it</button>

<script>
function myFunction() {
alert("Hello! I am an alert box!");
}
</script>

</body>
</html>

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is push() method in javascript?

702


In javascript what is an argument object?

874


Is python better than javascript?

644


Explain javascript closures by example.

697


Why do we need javascript?

686


How to convert json object to string?

763


Why do we need currying?

660


How to validate a form in javascript?

686


Explain few difference between null, undefined or undeclared javascript variable?

706


Explain javascript accessors ?

705


Name some of the built-in methods and the values returned by them.

803


How long does it take to learn coding?

787


What is the microsoft version of javascript?

746


What's the date object using javascript?

767


How about 3+5+"8"?

785