I have this element:
I want to get it\'s width in pixels. I just tried this:
You can use offsetWidth. Refer to this post and question for more.
offsetWidth
console.log("width:" + document.getElementsByTagName("div")[0].offsetWidth + "px");
div {border: 1px solid #F00;}