I deduce in the console

console.log(document.getElementsByClassName('wmd-view')) console.log(document.getElementsByClassName('wmd-view')[0].scrollWidth) 

Chrome displays that

  1. [div.col-lg-12.wmd-view] [0]: div.col-lg-12.wmd-view scrollWidth: 1347
  2. 1307

Why is that? The wmd-view parent has a width of 1307. How can I display this 1347

    1 answer 1

    jquery

     $('.wmd-view').outerWidth(true) 

    for parent

     $('.wmd-view').parent().outerWidth(true); 
    • does not work, tried everything, innerWidth, outerWidth, offsetWidth - user189452
    • jsfiddle.net can reproduce here or give a link to the project? - Anser
    • I can not, the project is internal, there is no access from the outside. And in jsfiddle it is displayed differently - user189452
    • .wmd-view this class one on page or a little? if several then explicitly point to the instance you need. more difficult to say without seeing the page. - Anser
    • And at what point do you display console.log? maybe you have not loaded everything yet? $ (window) .load (function () {console.log ()}) - Anser