In IE6, JS uses CSS to hide a select bug.

Source: Internet
Author: User

Today, when the table row TR is hidden
$ ID ("Tr _" + ID + "_ 1"). style. setattribute ('csstext ', "display: none ;");,
The SELECT statement in table row tr cannot be hidden in IE6 and will still be displayed on the page. To hide the Select style separately
$ ID ("new_attpm_id2 _" + id). style. setattribute ('csstext ', "display: none ;");
It cannot be hidden. search and find it online. ArticleIn IE6, JS hides a select bug through CSS. It turns out to be a bug in IE6 and can be hidden by style. Display = "NONE.
Final CodeThe following $ ID ("new_attpm_id2 _" + id). style. Display = "NONE"; the problem is solved smoothly.

Open ie6_js_hidden_select_bug.html in IE6.

Pass:

Document. getelementbyid ('J _ test'). style. Display = 'none ';
The Select element can be hidden.

But pass:

Document. Body. ID = 'page ';
With CSS code:

# Page select {display: none ;}
In IE6, the Select element cannot be hidden.
Failed to try position, setTimeout, zoom to 1.001 or other methods.

When I think of IE6, the notorious select bug that requires an IFRAME mask is estimated to be the same as the above bug. in IE6, select is a random wed element, its performance is essentially different from that of common HTML elements. Why? It is estimated that only Microsoft's source code can be viewed.

Related Article

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.