Hello World

hello.html
<!DOCTYPE html>
<html>
  <head>
    <meta charset="UTF-8" />
    <title>Hello World</title>
	<script src="hello.js"></script>
  </head>
  <body>
    <h1>Hello World</h1>
	<p>Beim Klicken wird Funktion hello aufgerufen.
	<p>Die Ausgabe erfolgt auf der Konsole (F12, Console)
	<p><button onclick="hello()">Klick mich</button>
  </body>
</html>
hello.js
// Globale Funktion hello definieren
// Code zwischen { und }
 
function hello() {
	 // Auf der Konsole ausgeben (Browser: F12 -> Console)
	console.log("Hello world!");  // Achtung: Strichpunkt nach jeder Anweisung!
}