Currently, I am working with two specific divs in my project: "#sidebar-wrapper" and ".j1". The height of ".j1" is dynamic as it changes based on its content. My objective is to set this height value to the "#sidebar-wrapper" element.
I have attempted to accomplish this task by using the following code:
var currentHeight = 0;
$(window).load(function() {
// Determine the natural height of the page and store it in a variable.
currentHeight = $('.j1').outerHeight();
console.log("Setting current height on load = " + currentHeight);
$("#sidebar-wrapper").resize(currentHeight);
});
However, I am unsure about the correct method to use in order to set the height of "#sidebar-wrapper".