I’m working on a little css/javascript toy where sliders give the user control over the css properties of elements on the screen. I was thinking that there might be a way in jQuery to extract the current styles of an element – I know that I can access them independently by doing something like
$("#foo").css("bar")
But it would be great if I could get at all of the styles applied to an object in one fell swoop. Possible? (Dumb idea?)
If it’s inline CSS, you could use this:
And to go above and beyond:
Example.