<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
</head>
<body>
<button onclick="alert('123')">点击</button>
</body>
</html>
![在这里插入图片描述](https://i-blog.csdnimg.cn/blog_migrate/a952107d4d73d008de492a32294d2ff0.png)
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
</head>
<script>
for (var i = 0; i <1000 ; i++) {
var a=i/100;
a=parseInt(a);
var b=i%100/10;
b=parseInt(b);
var c=i%10;
if(i==a*a*a+b*b*b+c*c*c){
document.write('水仙花数:'+i+'...');
}
}
</script>
<body>
</body>
</html>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
</head>
<script>
var x=8,y=2;
var c="/";
var sum;
switch (c) {
case "*":
sum=x*y;
document.write("结果是"+sum);
break;
case "/":
sum=x/y;
document.write("结果是"+sum);
break;
case "+":
sum=x+y;
document.write("结果是"+sum);
break;
case "-":
sum=x-y;
document.write("结果是"+sum);
break;
}
</script>
<body>
</body>
</html>
![在这里插入图片描述](https://i-blog.csdnimg.cn/blog_migrate/4700596e0ce59acaa00c86e06f6264bc.png)