I am trying to get the width / height values ββof an element in a dom tree (HTML page) and I use the method below:
var event = e || window.event;
var target = event.target || event.srcElement;
I get identifier and class information using
var classinfo = target.attributes.getNamedItem("class").nodeValue;
var idinfo = target.attributes.getNamedItem("id").nodeValue;
but, as you can guess, any element has no identifiers and / or classes, so I canβt check the
width = ".. px" node value or
the getElementById methodAs a result, is it possible to get the width and height of the node element using the
getNamedItem / method or any other that you can advise.
NOTE: I need to get the actual width and height, not css or inline, because maybe the width is 60% in css, but it displays as 100px ...
Thanks in advance.
source share