<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>第一题</title>
</head>
<body>
<button onclick="alert('12121')">按钮</button>
</body>
</html>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>第二题</title>
</head>
<body>
<script type="text/javascript">
var i,a,b,c;
for (i = 100; i < 1000; i++) {
a=parseInt(i/100);
b=parseInt((i-a*100)/10);
c=parseInt(i-a*100-b*10);
if( a*a*a+b*b*b+c*c*c == i){
document.write(i+"是水仙花数"+"<br>");
}
}
</script>
</body>
</html>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>第三题</title>
请输入第一个数字:<input type="text" id="x"/><br/>
请输入第一个数字:<input type="text" id="y"/><br/>
请输入运算符号 :<input type="text" id="z" placeholder="+ - * /"/><br/>
<button onclick="three()">点击计算</button>
</head>
<body>
<script>
function three() {
var x=parseInt(document.getElementById('x').value);
var y=parseInt(document.getElementById('y').value);
var z=document.getElementById('z').value;
var sum=0;
if(z=="+"){
sum=x+y;
}else if(z=="-"){
sum=x-y;
}else if(z=="*"){
sum=x*y;
}else if(z=="/"){
sum=x/y;
}
alert(sum);
}
</script>
</body>
</html>