I want to get html, including the selector that I use to get html
let's say that I have
<div id="foo"> <div id="bar">content</div> </div>
when i do $('#foo').html()
i get
<div id="bar">content</div>
Is there any way in jquery to get all html including parent (div selector)
I need all the html
<div id="foo"> <div id="bar">content</div> </div>
source share