看看这些代码 多敲多寄
<!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>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>范例4-8</title>
</head>
<body>
<script language="javascript">
<!--
for( i = 1; i<1000; i++ ) // 找出0到1000中3的公倍数
{
if( i%3 == 0 ) // 当模3为0时即是3位数
{
document.write( i + " " ); // 输出
}
}
-->
</script></body>
</html>