Detect if text has overflowed [duplicate]

If you are using jQuery, you can try comparing the div’s width to its scrollWidth.

if ($('#div-id')[0].scrollWidth >  $('#div-id').innerWidth()) {
    //Text has over-flown
}

Leave a Comment