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 are the limitations of javascript?

636


What are Cookies in Javascript?

739


How long does it take to get good at javascript?

607


Do you need to declare variables in javascript?

643


Are there any iphone Institutes which also train iphone automation testing in Hyderabad?

1744






Explain the role of deferred scripts in javascript?

658


How to get checkbox status whether it is checked or not?

675


How to find radio button selection when a form is submitted?

615


What is the function of javascript?

674


Explain how to detect the operating system on the client machine?

663


What is javascript hoisting?

694


What happens when the recursion calling is applied on two functions?

695


What are the difference between javascript and jquery?

707


What are the properties of stack?

664


What is design pattern in javascript? Explain

670