Javascript - Functions

1
2
3
4
5
6
function sayHello()
{
alert("Hello World!");
}
 
<button onclick="sayHello()">Click to say hello</button>