Pass value to a function : Function Parameters « Function « JavaScript Tutorial






<html>
<head>
<title>A Simple Page</title>
<script language="JavaScript">
<!--
function yourMessage(quote)
{
    alert(quote);
}
//  -->
</script>
</head>
<body>
<P>Click <input type="button" value="AAA" onClick="yourMessage('AAA')"> for a message!</p>
<br>
<P>Click <input type="button" value="BBB" onClick="yourMessage('BBB')"> for another message!</p>
</body>
</html>








7.3.Function Parameters
7.3.1.Pass value to a function
7.3.2.Pass number to a function
7.3.3.Pass integer to function
7.3.4.Pass Form value to a function
7.3.5.Use functionName.arguments to reference the arguments
7.3.6.Pass an array to a function