Height Balance

Make the heights of each div in a container equal height.

by Ori Drori

HTML

<div id="containers">
    <div id="one">d</div>
    <div id="two"></div>
    <div id="three"></div>
    <div id="four"></div>
    <div id="five"></div>
</div>

CSS

#one {
    background-color: green;
    width: 50px;
    height: 200px;
}
div {
    width: 50px;
}

JavaScript

$(function () {
    var heightBalance = {
        containerName: '',
        childElements: '',
        alert: function () {
            var divs = $(this.childElements);
            console.log(divs);
            $.each(divs, function (index, value) {
                console.log('working');
            });

        }
    }

    heightBalance.containerName = '#containers';
    heightBalance.childElements = 'div';
    heightBalance.alert();
});