JavaScript定义一个简单的乘法函数
下面的代码定义了一个myFunction函数,带有两个参数a和b,返回a*b的结果
<!DOCTYPE html>
<html>
<body>
<p>75271.com,This example calls a function which performs a calculation, and returns the result:</p>
<p id="demo"></p>
<script>
function myFunction(a,b)
{
return a*b;
}
document.getElementById("demo").innerHTML=myFunction(4,3);
</script>
</body>
</html>
