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 is array explain it?

447


How to empty an array in JavaScript?

518


Is python better than javascript?

441


How do I install javascript?

495


What is the instanceof operator in JavaScript?

507






How to convert javascript date to iso standard?

517


What are javascript functions?

473


What is difference between deep and shallow object coping in javascript?

526


How will you create new object in javascript?

526


Is javascript object oriented?

483


Explain unescape() and escape() in javascript?

559


Are you concerned that older browsers don't support javascript and thus exclude a set of web users? Individual users?

582


how to write frame work Architecture in QTP

1515


What is a boolean search?

474


Do hackers use javascript?

475