jQuery – How to get all styles/css (defined within internal/external document) with HTML of an element
outerHTML (not sure, you need it — just in case) Limitations: CSSOM is used and stylesheets should be from the same origin. function getElementChildrenAndStyles(selector) { var html = $(selector).outerHTML(); selector = selector.split(“,”).map(function(subselector){ return subselector + “,” + subselector + ” *”; }).join(“,”); elts = $(selector); var rulesUsed = []; // main part: walking through all … Read more