Javascript examples for Language Basics:Introduction
JavaScript allows you to define parameters for functions.
<!DOCTYPE HTML> <html> <head> <title>Example</title> </head> <body> <script type="text/javascript"> function myFunc(name, topic) { document.writeln("Hello " + name + "."); document.writeln("It is " + topic + " today"); };//from w w w .j a va2 s . c o m myFunc("Joe", "Monday"); </script> </body> </html>