title: How to get css property value in pure javascript
body: <p>I want to get the width of an element in percentage. I am using the following function to get the style but it gives the value in pixels. Here the variable style can be any css property like width, height etc.</p>
  
  <pre><code>this.getStyle = function(style) {
      var elementStyle = window.getComputedStyle(that.element);
      var value = elementName.getPropertyValue(style);
      return value;
  }
  </code></pre>