jQuery: set the width of a textarea?
- by AP257
What it says on the tin: how do I set the width of a textarea in jQuery?
I want to set the width of a textarea to match the width of a particular image. Using .width() works for setting the width of an image, but not of a textarea.
$(document).ready(function() {
var width = $("#my_image").width();
$("#another_image").width(width); // works
$("#my_textarea").width(width); // fails
});
How do I set the width of a textarea?