alert()

In this chapter you will learn:

  1. How to show an alert dialog in Javascript

alert dialog

alert() shows a message dialog:

<!DOCTYPE HTML> <!--   j av a  2s  .  co m-->
<html> 
    <body> 
        <script type="text/javascript"> 
            alert("message");
        </script> 
    </body> 
</html>

Click to view the demo

Next chapter...

What you will learn in the next chapter:

  1. How to close a window
Home » Javascript Tutorial » Window
Window Object
alert()
close()
confirm()
find()
Window height and width
location
window.moveBy
window.moveTo
window.open()
window.print()
window.prompt()
resizeTo(x,y) and resizeBy(xDelta,yDelta)
window.scrollTo(x,y)
screenLeft, screenX, screenTop, screenY
setInterval()
setTimeout()