MLMLTL MLMLTL - 1 year ago 43
Javascript Question

Dynamically set the height of a Button to be the height of a Textarea

This is a little thing, but I can't find anything at all in regard on how to go about doing it!

In the picture below, there is a

with a styled (and disabled)
purely for aesthetic purposes:

enter image description here

But when you resize the
, this happens:

enter image description here

This doesn't look so great.

I want to tie the dynamic height of the
to the height of the
so that they stay together at whatever height, but I cant find anything like this.

How do you tie an elements styling to another's?

Note - Much more confident at PHP than jQuery/javascript, but obviously won't refuse answers in those languages.

Answer Source

Either disable the resise of textarea using the following :

textarea {
    resize: none;

or use this fiddle(I did not create it) by making necessary changes.