Anonymous 0


Can anyone tell me which is the best solution to create a dynamic text area? I have this code:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "">
<html xmlns="">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<style type="text/css">
#test {
    background: #f90;
    width: 292px;
#test textarea {
    width: 278px;
    background: transparent;
    border: none;
    overflow: auto;
<div id="test">
<form action="" method="get">
<textarea name="txtArea" cols="" rows=""></textarea>

What i need is when someone writes a long message, the textarea box should expand automatically, the same for the background of div#test with the color #f90. If possible compatible with all major browsers and xhtml/css w3 validation.

If anyone can help me, i will appreciate a lot, thanks.


1 answer


Take a look at this simple JQuery plugin:

Not the only one, but a beginning.

Answered over 8 years ago by Roland Schulz
  • That's exactly what I would have recommended :P +1 o.k.w over 8 years ago