Q:

How to read a CSS value from JavaScript?

I was wondering how you could read and save to a variable the CSS value of a HTML element. For example say you have this:
<tr id="presentationProperty" style="display: none;">

I would want to be able to read the display: none property and save it to a variable inside JavaScript. Is this possible and if so, how?

A:

Easy:
var display = document.getElementById('presentationProperty').style.display;

Globally, you can access to styles properties of an element like this:
var getStyle = function(elementID, prop) {
  return document.getElementById(''+elementID+'').style[prop];
};

alert (getStyle('presentationProperty', 'display')); // block
alert (getStyle('presentationProperty', 'position'));
alert (getStyle('presentationProperty', 'backgroundColor'));
// ...

