From Volomike and jessica's answers on
http://stackoverflow.com/questions/2419749/jquery-get-selected-elements-outer-html: use .clone() and .wrap() with .parent() and .html(). Here it is as an extension:
$(function() {
$.fn.outerHTML = function() {
return $(this).clone().wrap('<div></div>').parent().html();
}
});
and use it like this:
$("#myItem").outerHTML();
salam kenal bos. lagi jalan jalan pagi nih
ReplyDelete