Javascript function

A function is a group of reusable codes. which can be called anywhere in the program. this eliminates the need of writing the same codes again and again.

By using javascript we can use an inbuilt function as well as we can create our own javascript function.

We can create javascript function by using a function keyword followed by a unique function name, can specify a list of parameters or values, and a statement block 
surround by curly brackets {}.

Syntax:
Function <functionname> (parameter/values list)
{
Statements;
}

e.g.
<html>
<head>
<title>My first web page</Title>
<Script language="Javascript">
Function myfunction()
{
document.write("Welcome to JavaScript");
}
</Script>
</head>
<body>
</body>
</html>
Output: Welcome to JavaScript

Related Topics:
  1. JavaScript Introduction
  2. Variables in JavaScript
  3. JavaScript Function
  4. Accessing JavaScript Function
  5. Creating JavaScript interactive form
  6. Accessing form field value
  7. Creating interactive form login webpage
  8. Networking Fundamentals
  9. TCP/IP and Internet addressing
  10. Internet Working
  11. Internet Working Servers
  12. Concept and need for web publishing
  13. Web languages
  14. Javascript Control Structure
  15. Checking Text is Letter/s
  16. Checking Text is Number/s
  17. Checking Textbox is Empty or not
  18. Addition of two numbers
  19. Subtraction of two numbers
  20. Multiplication of two numbers
  21. Division of two numbers
  22. Form field validations
  23. Email validation