$.outerHTML($("#eleID")); // will return outerHTML of that element and is// same as$("#eleID").outerHTML();// or$.outerHTML("#eleID");// or$.outerHTML(document.getElementById("eleID"));
// Gives you the DOM element without the outside wrapper you want$('.classSelector').html()
// Gives you the outside wrapper as well only for the first element$('.classSelector')[0].outerHTML
// Gives you the outer HTML for all the selected elementsvar html = '';$('.classSelector').each(function () {html += this.outerHTML;});
//Or if you need a one liner for the previous code$('.classSelector').get().map(function(v){return v.outerHTML}).join('');