Hi i have the following html code
<div id="im" style="width:20px; color:red;" >12</div>
i need to get this html structure <div id="im" style="width:20px; color:red;" >
to a variable . How i get this ?
To get the text , or content inside the div we can use
$( "#im" ).html();
But i want to get the htm structure , not the content . Please help.
Edit
i understand that we can use $( "#im" ).prop('outerHTML');
From this result how can i get the width
?
i know we can use .css("width"), but i need to get this from prop('outerHTML')
.
Please help .