Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

alert

  • alert
  • script
  • ;

{aside} Probably the simplest way to see some action from JavaScript is to embed an alert() call in an html file. {/aside}

<html>
<head>
    <title>alert example</title>
</head>
<body>
<h1>Welcome to JavaScript</h1>

<script language="javascript">

alert("Hello World");

</script>

More HTML
</body>
</html>
  • Not really used any more
  • always put ; at the end of statements