[ACCEPTED]-jQuery: Get HTML including the selector?-jquery-selectors
Accepted answer
In this specific case:
var outerHTML = $("<div />").append($('#example').clone()).html();
See this page for more details.
And 3 the discussion here: http://api.jquery.com/html/ (this explains that 2 this isn't in jQuery core and why some logical 1 solutions won't work)
You could try this:
var html = $('<div>').append($('#example').clone()).html();
0
Source:
stackoverflow.com
More Related questions
Cookie Warning
We use cookies to improve the performance of the site. By staying on our site, you agree to the terms of use of cookies.