How can you control the showing of the scrollbars from JavaScript for a TEXTAREA?

John Zukowski

The scrollbar setting is done by setting the CSS 'overflow' attribute of the text area. Here's an example:

<SCRIPT language=JavaScript>
function setOverflow(field, setting) {
    field.style.overflow = setting;

<form name="foo">
  <textarea name="ta" rows="2" cols="20">

<SELECT onchange="setOverflow(foo.ta,
0 Comments  (click to add your comment)
Comment and Contribute






(Maximum characters: 1200). You have 1200 characters left.