我想在这个id上显示无('+ gridId +'_ blanklaTop)但不能正常工作。 为什么这仍然显示?
我的代码如下:
if (searchRecord(gridId,'blankTop')){
html += '<img id="' + gridId + '_blankTop" src="./img/blank.png" height=40px width="90%" style="display:block">';
} else {
html += '<img id="' + gridId + '_blankTop" src="./img/blank.png" height=40px width="90%" style="display:none" >';
}
document.body.innerHTML += html ;
for(b=0; b<Object.keys(memberList.member).length; b++){
var num = Object.keys(memberList.member)[b];
var memberData = memberList["member"][num];
var leave = memberData.split(",");
if(d2 == num){
document.getElementById('' + gridId + '_blankTop').style.display = 'none';
html +='<div style="padding-left:16px; display:none;" id="' + num + '_amLeave"><span style="font-size:1.3em" id="' + gridId + '_Leave" >AM-' + leave[0] +' <br/></span></div>';
}
}