1// Calculate height according to the div width
2$(function() {
3 var myDivWidth = $(".main-div").css("width") + "px";
4 // the variable will now have our div width
5 $(".main-div").css("height", myDivWidth)
6 // Another Way
7 $(".main-div").css({
8 "height": myDivWidth
9 })
10})
1$(document).ready(function() {
2 var divHeight = $('.col-1').height();
3 $('.col-2').css('min-height', divHeight+'px');
4});
5