I'm trying to set a div's height in relation to another div. 'gridimg' has an image in it and 'gridtext' has text so when the page is resized, the div containing the text changes height. I have the following code in a .js file:
window.onresize = function resize() {
var right = document.getElementById('gridimg').style.height;
var left = document.getElementById('gridtext').style.height;
document.getElementById('gridimg').style.height=left;
});
I'm trying to get it to call this function when the window is resized so the divs stay the same size but it's not working. I'm new to external javascript so could anyone help me :)