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
What is console.log()?
how do you declare variables in javascript?
What is a method in javascript?
How to use one javascript function for multiple input fields?
What is the purpose of using javascript?
What is the difference between attributes and property?
How to handle event handlers?
How to change the background color of HTML document using JavaScript?
How to read elements of an array in JavaScript?
How to validate a form in javascript?
What boolean operators can be used in JavaScript?
What are the pop-up boxes available in javascript?
What does trim stand for?
Where should I put script tags?
What value does prompt() return if the user clicked the cancel button?