It makes no sense appending an <h3>
INTO <h4>
.
I guess what you want is to place <h3>
AFTER <h4>
, swapping their positions (although it still makes less sense if you're using these tags, but anyway)
$('#calendar-feed li.event h3').each(function (i, h3) {
var $h3 = $(h3);
$h3.after($h3.closest('li').find('h4'));
});
Alternatively if you want the <h3>
guaranteed to be the last element in each <li>
, then do this
$('#calendar-feed li.event h3').each(function (i, h3) {
var $h3 = $(h3);
$h3.appendTo($h3.closest('li'));
});
DEMO: http://jsfiddle.net/terryyounghk/sN7Mf/