Compatibility Test (1)

Source: Internet
Author: User
1. Leading blank leading blank in innerhtml of IE6, IE7, and IE8 will not retain leading blank var DIV = document. createelement ('div '); Div. innerhtml = "<div> </div>"; return Div. firstchild. nodetype = 3 ;}
2, tbodyie6, IE7 will automatically add tbodyfunction tbody () {var DIV = document. createelement ('div '); Div. innerhtml = "<Table> </table>"; Return !! Div. getelementsbytagname ('tbody'). length ;}
3. getattribute of href, SRC, width, heightie6, and IE7 will return formatted href, SRC, width, height. the getattribute of IE has two parameters. If the second parameter is set to 2, the specified parameter is strictly returned.
4. The default function checkon () {var DIV = document. createelement ('div '); Div. innerhtml = '<input type = "checkbox"/>'; var input = div. getelementsbytagname ('input') [0]; return input. value = 'on ';}
5. clonecheckedie does not copy the checked attribute function clonechecked () {var DIV = document. createelement ('div '); Div. innerhtml = '<input type = "checkbox"/>'; var input = div. getelementsbytagname ('input') [0]; input. checked = true; return input. clonenode (true ). checked ;}
6. Check whether the selected Attribute of the selected option is trueie and falsefunction optselected () {var select = document. createelement ('select'); var opt = select. appendchild (document. createelement ('option'); Return OPT. selected ;}
7. optdisabled: checks whether option is disabled when select is disabled. If false is disabled, falsefunction optdisabled () {var select = Document is returned. createelement ('select'); var opt = select. appendchild (document. createelement ('option'); select. disabled = true; return OPT. disabled ;}

Compatibility Test (1)

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.