How to display Alert in JavaScript



How to display Alert in JavaScript..

Answer / 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

More JavaScript Interview Questions

What are the distinct types of error name values?

0 Answers  


What is a null variable in javascript?

0 Answers  


How do I add javascript to chrome?

0 Answers  


How to define a named function in JavScript?

0 Answers  


What are the ways of making comments in javascript?

0 Answers  


Will javascript be replaced?

0 Answers  


What are the advantages of using external javascript?

0 Answers  


What is a fixed-width table and its advantages?

0 Answers  


How to define name function in javascript?

0 Answers  


What is the concept of “functions as objects” and how does this affect variable scope?

0 Answers  


What is a good javascript editor?

0 Answers  


How do functions work in javascript?

0 Answers  


Categories