Problems with jQuery $.each

Problems with jQuery $.each

Hey,

I've been trying to use jQuery each to count the total height of all elements with the same class. The code below does not work and the alert that I put in for debugging always returns as 0.

Any help would be appreciated.

  1. var current_th = 0;
  2. $('.noteWindow').each( function(index, domEle) {
  3. var current_th = + $(this).height();
  4. });
  5. alert(current_th);