大布and科比
2015-07-29 11:33
<!DOCTYPE HTML>
<html >
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>流程控制语句</title>
<script type="text/javascript">
//第一步把之前的数据写成一个数组的形式,定义变量为 infos
var infos=[["小A","女",,"大一"],["小B","男",,"大三"],["小C","男",,"大四"],["小D","女",,"大一"],["小E","女",,"大四"],["小F","男",,"大一"],["小G","女",,"大二"],["小H","女",,"大三"],["小I","女",,"大一"],["小J","男",,"大三"]];
for(var i=0;i<10;i++){
if(infos[i][3]=="大一"){
if(infos[i][1]=="女"){
document.write(infos[i]+"<br>");
}
}
}
</script>
</head>
<body>
</body>
</html>
是的!
JavaScript进阶篇
468194 学习 · 21891 问题
相似问题