Could make this a one liner. $("#area-container-div, #right-div").css("width", maxWidth);