Looping function to copy and insert innerhtml from child to parent

Looping function to copy and insert innerhtml from child to parent

html -

 <div class="dog"></div>
  <div id="cat">
  <h1 class="food">text1</h1>
  </div>

current jquery (not working) -

$(".food").each(function () {
 $(this).parents().prev('.dog').html($(this).html());
});

also this is for tumblr, to allow me to add custom text to a posts parent div by setting a class to a piece of the posts text