I'm trying to wrap a jQuery object in a list. The object is
<a class="medium button" title="Title"">Sample</a>
and the interaction
$(".medium").click(function() {
$(".list4").append("<li>");
$(".list4").append($(this));
$(".list4").append("</li>");
});
but this inevitably ends up in a blank list item. But if I do something like
$(".medium").click(function() {
$(".list4").append("<li>");
$(".list4").append($(this).html());
$(".list4").append("</li>");
});
the item doesn't have the link. What should I do?