Quackit Logo

Got a MySpace Page?

Get "www.yourname.com" for your MySpace page. Learn how >>.

JavaScript Alert Box

Print Version

The JavaScript alert box is useful for alerting your users to something important. When a JavaScript alert box is triggered, a small box will pop up and display the text that you specify in your JavaScript code.

To create a JavaScript alert box, add the following within the <head> tags of your HTML document:

<script type="text/javascript">
alert('Enter your JavaScript alert box message here')
</script>

That's all the code you need to create a JavaScript alert box, however, you will need to decide when this alert box should appear.

You could put this code into a function and then call that function when a certain event occurs.

Enjoy this website?

  1. Link to this page (copy/paste into your own website or blog):
  2. Add this page to your favorite social bookmarks sites:
                     
  3. Add this page to your Favorites

Oh, and thank you for supporting Quackit!