I have a collection of textareas I am getting using a selector. I am then iterating through and trying to set the max width for each based on its current width(they are not all the same, that is why I am doing it this way). However, I can not access the .css property of the elements in the array, I guess because they are HTMLTextAreaElements? Is there a way to make this work or a better way to approach this?
I can not set the max width statically because this is a generic control that is used in a variety of pages and with a variety of different sizes.
$(function () {
var a = $('.myTextAreaCssClass');
for(var i = 0;i < a.length; i++) {
var w = a[i].css(width);
a[i].css('max-width',w);
}
});