<!DOCTYPE html>
<html>
<head>
<style type='text/css'>
#foo {
background: green;
width: 80px;
}
</style>
<script type='text/javascript'>
function getWidth() {
var elem = document.getElementById("foo");
var theCSSprop = window.getComputedStyle(elem, null).getPropertyValue("width");
console.log(theCSSprop);
}
</script>
</head>
<body>
<div id="foo" onClick="getWidth()">Hello World. click and check the console.</div>
</body>
</html>