Hi, I've got the following piece of code that extracts the html code contained within a clicked element:
$("p,h1,h2,h3,span,li, dd, dt,b,em,strong").click(function() { alert($(this).html()); }); I want to get the containing element from this too, it's open and close tag. For example: <div id="test-div"> <h1>text in <strong>here</strong></h1> </div> The above code would return "<h1>text in <strong>here</strong></h1>" - how can I return the div tag and it's attributes too? Thanks, Colin. -- View this message in context: http://old.nabble.com/Extract-tag-element-and-closing-tag-tp26512422s27240p26512422.html Sent from the jQuery General Discussion mailing list archive at Nabble.com.