I have two divs, box and stylewidth. stylewidth is a child of box, which I’ve tried to make as large as stylewidth in a function. to that end I’ve added this line.
$("#box").width(("#styleWidth").width);
The problem is, box doesn’t change in size, and I’m not sure why. is this the correct method?
You forgot the parenthesis on the inner width() function and the dollarsign, and make sure you wrap it in document.ready or add it after the elements are loaded in the DOM: