Is there a way to get elements of different types to match exactly in size? For example, I have a textarea and a div. I want to make the div height and width match that of the text area exactly when the page loads. I have the following javascript called by onLoad().
However, when the page loads the div ends up being a little bit wider than the textarea. Am I using the right attributes?
Thanks in advance.
Troy
Code:
document.getElementById('aDiv').style.height = document.getElementById('aTextarea').clientHeight;
document.getElementById('aDiv').style.width = document.getElementById('aTextarea').clientWidth;
However, when the page loads the div ends up being a little bit wider than the textarea. Am I using the right attributes?
Thanks in advance.
Troy