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 you get the reference of a caller function inside a function?

0 Answers  


How many data types are there in javascript?

0 Answers  


What’s relationship between javascript and ecmascript?

0 Answers  


What is event bubbling in JavaScript?

0 Answers  


Public Static Void Main(String args[]) { System.out.in("Hai.."); } In the above code why string args[] is required.... If we are not giving command line argument..

0 Answers  






What is a currying function?

0 Answers  


Is javascript a dynamic language?

0 Answers  


Define escape() function?

0 Answers  


How to manage exception handling in javascript?

0 Answers  


What is the use of 'bind' method in JavaScript?

0 Answers  


What is the javascript function?

0 Answers  


Is javascript free to use?

0 Answers  


Categories