jQuery(document).ready(function ($) { var hts = []; $('.session-involve-content').each(function () { hts.push($(this).outerHeight()); }); var mh = Math.max.apply(Math, hts); $('.session-involve-content').css('min-height', mh); var hts = []; $('.text-involve-content').each(function () { hts.push($(this).outerHeight()); }); var mh = Math.max.apply(Math, hts); $('.text-involve-content').css('min-height', mh); });