TEXTAREA element IE6/7/8/9/10 has a top-down scroll bar by default

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.