<!DOCTYPE HTML>
<html >
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>函数</title>
<script type="text/javascript">
//定义函数
function add3(){
var x=parseInt(prompt('先输入一个值'));
var y=parseInt(prompt('再输入一个值'));
if(x>y){
document.write(x);
}else if(y>x){
document.write(y);
}else{
document.write("他们相等,你耍我呢");
}
}
</script>
</head>
<body>
<input type='button' value='大小比较' onclick="add3()">
</body>
</html>