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

How can javascript be used to personalize or tailor a web site to fit individual users?

0 Answers  


Why do you need javascript?

0 Answers  


What is event in web programming?

0 Answers  


Is array an object javascript?

0 Answers  


What is the difference between Local Storage and Session Storage?

0 Answers  






Are Typescript and Javascript the same?

0 Answers  


What are the characteristics of javascript ‘strict mode’?

0 Answers  


how to validate the date(dd/mm/yyyy)using regular expression in javascript? It should also satisfy the leap year feb 29 problem. Please help me.

1 Answers  


What are types of javascript?

0 Answers  


How do I use javascript to password-protect my web site?

0 Answers  


What does 3 dots mean in javascript?

0 Answers  


What is the difference between firstChild and firstElementChild?

0 Answers  


Categories