html table
본문
<script>
var www = {
"DESCRIPTION" : {"LEND_DT":"대여일자","YEAR_CD":"연령대코드","MEMBER_CD":"사용자코드","MEM_CNT":"신규가입자수","SEX_CD":"성별"},
"DATA" : [
{"member_cd":"내국인","lend_dt":"2018-05-19","mem_cnt":"86","year_cd":"30대","sex_cd":"F"},
{"member_cd":"외국인","lend_dt":"2018-05-19","mem_cnt":"205","year_cd":"80대","sex_cd":"M"},
]
};
<form>
<p><h3>성별</h3>
<input type="checkbox" name="sex_cd" value="M" > 남자
<input type="checkbox" name="sex_cd" value="F" checked> 여자 </p>
검색 단어: <input type=text name="key" value="내국인" />
필드: <input type=text name="field" value="member_cd" />
<input type=submit onclick="search()" value="찾기">
</form>
<script>
function search() {
var s = document.getElementsByName("year_cd")[0].value;
var w = document.getElementsByName("sex_cd")[0].value;
var sex_cd = new RegExp(w);
var year_cd = new RegExp(s);
var k=document.getElementsByName("key")[0].value;
var key = new RegExp(k);
var f=document.getElementsByName("field")[0].value;
document.write("Data:<br><table border=2><tr><th>no.</th>");
for(k in wifi.DATA[0])
document.write("<th>"+k+"</th>");
document.write("</tr>");
var cnt=0;
for(i in wifi.DATA) {
if(key.test(wifi.DATA[i][f])) {
cnt++;
document.write("<tr><td>"+i+"</td>");
for(k in wifi.DATA[i]) document.write("<td>"+wifi.DATA[i][k]+"</td>");
document.write("</tr>");
}
}
document.write("<tr><th>Found</th><th>"+cnt+"</th><th colspan=8>End of Search</th></tr>");
document.write("</table>");
}
</script>
이렇게 해서 테이블박스에 체크된 여성과 검색어에 입력한 여성만 어떻게 출력하나요? ㅠ
html 바로 제ㅔ출누르면 표 출력되게 부탁드려요.
자식창에 입력한 것을 부모창에 띄우려면 ..