[Greasemonkey] max-width textarea?

Nikolas Coukouma lists at atrus.org
Fri Nov 4 15:12:31 EST 2005


Chris Hayes wrote:
> I need to limit the width of a textarea (name="bericht", no ID, no CSS 
> class).
> I tried to start with max-width.
>
> This works:
> unsafeWindow.document.forumpostform.bericht.style.width='300px';
>
> This does not work:
> unsafeWindow.document.forumpostform.bericht.style.max-width='300px';
>
> is there a solution for this? 
The - is used for subtraction, so it's probably parsed as
style.max - width = 300
To avoid this problem, properties with dashes are usually collapsed and 
the first letter of each part capitalized
, so max-width becomes maxWidth. You can also use style.setProperty
unsafeWindow.document.forumpostform.bericht.style.setProperty('max-width', 
'300px', '');


-Nikolas


More information about the Greasemonkey mailing list