var e = document.getElementById("edditLessonContent"); if(e.offsetWidth > e.parentNode.offsetWidth) { /* сделать, что надо */ }