TEXTAREA element IE6/7/8/9/10 has a top-down scroll bar by default
There are scroll bars up and Down under IE. No other browsers. Look at an example first
12345678910 |
<!
DOCTYPE HTML>
<
HTML
>
<
HEAD
>
<
meta charset="utf-8" />
<
title
>textarea</
title
>
</
HEAD
>
<
BODY
>
<
textarea
></
textarea
>
</
BODY
>
</
HTML
>
|
TextArea does not have any style, IE6/7/8/9/10 below
The circled section can see the upper and lower scroll bars appear. None of the other browsers. Looking at the value of overflow,
12345678910111213141516171819202122232425 |
<!
DOCTYPE HTML>
<
HTML
>
<
HEAD
>
<
meta charset="utf-8" />
<
title
>textarea</
title
>
</
HEAD
>
<
BODY
>
<
textarea
></
textarea
>
<
script
>
function getStyleProperty(el, name) {
var cssStyleDeclaration, val;
if(window.getComputedStyle) {
cssStyleDeclaration = window.getComputedStyle(el, null);
}else{
cssStyleDeclaration = el.currentStyle;
}
return cssStyleDeclaration.getPropertyValue(name);
}
var area = document.getElementsByTagName(‘textarea‘)[0];
var overflowVal = getStyleProperty(area, ‘overflow‘);
alert(overflowVal);
</
script
>
</
BODY
>
</
HTML
>
|
IE6/7/8/9/10 popped the scroll, not the other browsers. The processing of IE is very puzzling, the textarea has not yet entered the content has appeared the scroll bar. If you want to remove it, simply set the Overflow:auto.
TEXTAREA element IE6/7/8/9/10 has a top-down scroll bar by default