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>
A function is written as a code block (inside curly { } braces), preceded by the function keyword:
function functionname()
{
some code to be executed
}
software development in Indore , [URL=“http://www.parkhya.com/Pages/Training.aspx”]Java Traning in indore ,[URL=“http://www.parkhya.com/”]MCA Training in indore
[TABLE]
[TR]
[TD][/TD]
[/TR]
[/TABLE]

[TABLE]
[TR]
[TD][/TD]
[/TR]
[/TABLE]
[TABLE]
[TR]
[TD][/TD]
[/TR]
[/TABLE]