Q:

How can I use jQuery to assign every element in a class its current height to its data-height attribute?

So if I were dealing with just one element, I could use the following:
$("#id").attr( "data-height" , $("#id").css("height") );

But is there any way to do this with every element in a class?

A:

$('.myElem').each(function() {

    $this = $(this);
    $this.attr('data-height', $this.height());

});

You could also just use the .data() method
$('.myElem').each(function() {

    $this = $(this);
    $this.data('height', $this.height());

});

