倒金字塔
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>圣诞树</title>
<style>
span{
text-align: center;
}
</style>
</head>
<body>
<span><h1>打印倒金字塔</h1></span>
<hr width="800px"/>
<hr width="700px"/>
<hr width="600px"/>
<hr width="500px"/>
<hr width="400px"/>
<hr width="300px"/>
<hr width="400px"/>
<hr width="500px"/>
<hr width="600px"/>
<hr width="700px"/>
<hr width="800px"/>
</body>
</html>
邮箱
<!DOCTYPE html>
<html>
<head lang="en">
<meta charset="UTF-8">
<title>圣诞树</title>
</head>
<body>
<script type="text/javascript">
function validateEmail(email){
var indexs=email.indexOf("@");
if(email.length>0){
if(indexs==-1|| email.indexOf(".")==-1)
alert("邮箱地址必须包含@和.");
else{
var name=email.substring(0,indexs);
alert("邮箱地址正确");
}
}else{
alert("邮箱不能为空!");
}
}
validateEmail(prompt("请输入正确的邮箱地址","****@qq.com"));
</script>
</body>
</html>
星期几
<!DOCTYPE html>
<html>
<head lang="en">
<meta charset="UTF-8">
<title>圣诞树</title>
</head>
<body>
<script type="text/javascript">
prompt("请输入今天星期几?","")
alert("好好休息")
</script>
</body>
</html>