通过document.getElementById()获取一个特定的对象,
用一个变量接收:var myObjectd=document.getElementById("XX");
通过这个变量可以改变HTML内容:myObject.innerHTML="XXX";
改变style样式:myObject.style.color="red"; color/background/font-size/...
myObject.style.display="none";//隐藏
myObject.style.display="block";//块元素,显示~
@二维数组筛选信息:
var infos=[['A','woman','21','大一'],['B','man','31','大三'],['c','woman','21','大一'],['d','woman','21','大一'],['e','woman','21','大一']];
for(var i=0;i<5;i++){
if(infos[i][3]=='大一'&&infos[i][1]=='woman'){
document.write(infos[i][0]+" ");
}
}