console.log(isNullObj(cont1.text())); console.log(isNullObj(cont2.text())); console.log(isNullObj(cont3.text())); if (isNullObj(cont1.text())) { $("#btxs1").hide() } if (isNullObj(cont2.text())) { $("#btxs2").hide() } if (isNullObj(cont3.text())) { $("#btxs3").hide() } if (isNullObj(cont1.text()) && isNullObj(cont2.text()) && isNullObj(cont3.text())) { $(".article-body .article-content .article-right").css("display","none"); $(".article-body .article-content .article-left").css("width","100%"); } }); function doZoom(size){ document.getElementById('zoom').style.fontSize=size+'px'; $('#zoom p').css('font-size',size); } function isNullObj(obj){ if(obj==null){ return true; }else if(obj.replace(/\s*/g,"")==""){ return true; }else{ return false; } }