xxxxxxxxxx
<!DOCTYPE html>
<html>
<title>JavaScript 函数传参示例 - 基础教程(div.cn)</title>
<body>
<p>" div.cn"的值通过name参数传递到函数中:</p>
<script>
// 定义函数
function greet(name) {
document.write("Hello, " + name);
}
// 以"div.cn"作为参数调用greet函数
greet("div.cn");
</script>
</body>
</html>