let div = document.getElementById('wrapper');
let img = div.querySelector('img');
console.log(getComputedStyle(div).width);
console.log(getComputedStyle(div).height);
/*или*/
function isHidden(elem) {
return !elem.offsetWidth && !elem.offsetHeight;
}
console.log(isHidden(div));
1 个回答