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

Define unescape() function?

534


What boolean operators can be used in JavaScript?

528


What are the requirements of web application using javascript?

527


What is escape & unescape String functions in JavaScript?

545


What is jscript used for?

476






What is the difference between push() and concat() in javascript?

526


How dhtml is used in javascript?

447


What is the use of a set object in javascript?

498


What is the use of debugger keyword in javascript?

500


What are the primitive data types in JavaScript?

547


What is callback?

590


How to write comment in JavaScript?

981


How to check if a variable is an integer in javascript ?

542


Where can I learn javascript for free?

500


Is there automatic type conversion in JavaScript?

541