How to get the height of the block to JS in FF?

Visit many of the same blocks with class="myclass" I need to get the height of these blocks, it will get the height of the first (zero) from the array:
var arr = document.getElementsByClassName('myclass')[0];
var style = window.getComputedStyle(arr, null);
var BW = style.getPropertyValue('border-width');
colnsole.log(BW );

In Chrome the code works correctly and gives the height, in FF and IE11 the value of BW refused blank. What is a mistake is made cross-browser?
June 14th 19 at 18:50
1 answer
June 14th 19 at 18:52
I can't say but as for me in 2017 is already possible to use document.querySelector to search for in the document. In IE8+ poidee will work.
Yes it worked
var el = document.querySelector(".myclass");
but then still not particularly clear how we can obtain the value of the frame size of the block unit, for example options:
var b = el.border;
 var b = el.clientBorder;
 var b = el.clientBorderWidth;

All wideout undefined. Other options just get a syntax error - ines_Sta commented on June 14th 19 at 18:55
, console.log(el)

And then expand the object and look for the desired property. - leonor36 commented on June 14th 19 at 18:58
Yes, I just tried console.dir and not log all my searches ended in failure, whether it is not there (could it be?) if I can't find it... - ines_Sta commented on June 14th 19 at 19:01
in result , you get a dom node and can be read or set from it styles referring to SV-vu style ie to better understand climb in the documentation of the dom api, but the easiest way you can use jquery/jqlite IMHO - caroly commented on June 14th 19 at 19:04
border is also undefined checked - ines_Sta commented on June 14th 19 at 19:07
can't be,if border is not set then return an empty string
use the console to view the object and all the properties that he has,it will be faster
UPD if you need blocks a lot,use document.querySelectorAll - caroly commented on June 14th 19 at 19:10

Find more questions by tags JavaScript