I am working on achieving a specific task and this JS fiddle represents one part of it.
alert($("#content")[0].outerHTML);
When executed, this code returns the following DOM structure:
<div id="content">
<div id="example1" style="width:100px height:100px background-color:red"></div>
<div id="example2" style="width:50px height:50px background-color:blue"></div>
<div id="example3" style="width:25px height:25px background-color:yellow"></div>
</div>
My goal is to dynamically add div
elements with inline CSS. I aim to retrieve both the div
elements and their CSS attributes separately as text elements in the end.