Thursday, 21 January 2016

JavaScript Functions

A function is a block of code that will be executed when "someone" calls it:

<!DOCTYPE html>
<html>
<head>
<script>
function
myFunction()
{
alert("Hello World!");
}
</script>
</head>

<body>
<button
onclick="myFunction()">Try it</button>
</body>
</html>

0 comments:

Post a Comment