How to get all css property and its value from an element ?
I am trying to make a plugin for live editing css of an element. If an element have already any style then get it and append value to input fields so that I can edit already set styles.
I dont have the property name, so how to run a loop and and get all css property and its value. and then put it an array.
my dummy code
function get_css(elem){
var newObj = {};
elem.each(function(){
var css = this.css('?');
newObj[parts[property]] = parts[value];
});
return newObj;
}
Here is the fiddle http://jsfiddle.net/howtoplease/4Nv2C/