Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8389561
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T18:45:41+00:00 2026-06-09T18:45:41+00:00

A bit of (JS-modified) HTML might look like this: <div style=width: 50px;>1,234,567</div> How do

  • 0

A bit of (JS-modified) HTML might look like this:

<div style="width: 50px;">1,234,567</div>

How do I detect if the text node is wider than the container?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T18:45:43+00:00Added an answer on June 9, 2026 at 6:45 pm

    As inspired by How to detect overflow in div element?:

    <!-- Overflowing -->
    <div style="width: 50px;">1,234,567</div>
    
    <!-- Not overflowing -->
    <div>1,234,567</div>
    

    JavaScript (no jQuery) to detect:

    var divs = document.getElementsByTagName('div');
    var i, div, overflowing;
    
    for (i=0; i<divs.length; i++) {
        div = divs[i];
        overflowing = div.offsetWidth < div.scrollWidth;
        console.log(overflowing);
    }​
    

    http://jsfiddle.net/mattball/pYj5P/

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This is an example from a book, a bit modified. It seems like sessions
I found this HowTo and modified the script a bit, but I would like
So lets take a look onto a littel bit modified example code: #include <stdio.h>
I'm a bit lost with Subversion (1.5+) here: I modified the trunk in my
I took the standard Item GridView template and modified it a bit to fit
I'm trying to develop a bit of VBA that will check the date modified
Say I have assembly A. It was modified with Mono.Cecil a little bit. Now
Bit of a puzzle for you.... I have a 730px wide, auto height div.
Bit of a javascript newbie so not sure if this question is easy or
This will take a bit of explanation so I hope I don't lose everyone

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.