How do I export dom values of element to css file equivalent
I have element that are being dynamically updated and开发者_如何学C I want to generate a css file which contains the rendered styles for that element. Is there anything that does this? Thanks.
There is nothing I know of in jQuery or JavaScript that does this intrinsically. However, if you just want it for yourself and not for dynamically creating stylesheets, then I recommend Firefox and the Firebug plugin. This will show you the CSS live and you can modify and export it, as well.
getComputedStyle gives you the computed style of an element:
window.getComputedStyle($("#my_element").get(0))
精彩评论