您的位置:首页 > Web前端 > JavaScript

javascript的函数调用

2013-12-18 08:56 225 查看
<html>
<head>
<title>document.write</title>

<script>

function show(){
alert("hello");
}

//直接调用
//show();

//事件响应

//function add(var x,var y) 不正确的写法
function add(x,y){
return (x + y);
}

alert(add(1,3));

</script>

</head>

<body>
<!--事件响应-->
<input type ="button" value="click" onclick="show()"/>
</body>

</html>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: