Hey there, I'm facing an issue on my HTML page where I have jQuery included.
In my CSS file, I have quite a lot of lines and I'm trying to figure out how to read all styles for a specific element from the external CSS file rather than the inline styles...
I found this code snippet that I thought would do the trick:
var styleProperties = {};
var getCssProperties = ['width', 'margin', 'height'];
for (c = 0; c <= returnStyleProps.length; c++) {
styleProperties[returnStyleProps[c]] = $('div#container').css(returnStyleProps[c]);
alert(styleProperties);
}
alert(styleProperties);
However, when I run the code, it only seems to alert:
"[Object Object]"
[edit] Can someone please help? I've been stuck on this and nothing seems to work :( [/edit]