I need to get all the css applied to an element by id or by class I need the css custom css only
I have this function which returns all css including the browser default built in css, i need only the applied css, like how firebug would work.
Firebug is not sufficient for me to use as i need the data to be exported into json eventually and used in various ways.
This needs to be a javascript or jquery solution only.
This is what i have so far
<div id="elemId" style="border:1px solid red;">
var elem1 = document.getElementById("elemId");
var style = window.getComputedStyle(elem1, true);
console.log(style);
So in general i need to know what css has been applied to this object i need all external and inline css. i cannot use a single getProperty by name because in most cases i do not know what has been applied, i need the full list of custom css.
Please only submit code you have tested yourself, dont paste from other forums without testing code.
Thanks Daniel