标签:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<style type="text/css">
.a:hover
{ font-size:2em;}
</style>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
</head>
<body>
找出1~100内与8有关的数并显示出来<br />
<input class="a"type="button" value="查找1~100之间与8有关的正整数" style="width:60%; " onclick="chazhao()"/><br />
</body>
</html>
<script>
function chazhao()
{
var src = " ";
for(var i =1;i<=100;i++)
{
if(i%8==0||i%10==8||parseInt(i/10)==8)
{src = src+i+", " }
}
alert(src)
}
</script>
标签:
原文地址:http://www.cnblogs.com/HRZJ/p/5813063.html