window offsetwidth code example Example: bassed on text length find offset width in javascript <div id="Test"> abcdefghijklmnopqrstuvwxyzA </div>