In IE6 and IE7, how does innerhtml obtain Param?

Source: Internet
Author: User

Code : Copy code The Code is as follows: <HTML>
<Head>
<SCRIPT type = "text/JavaScript"> <! --
Function setmode (newmode)
{
VaR text1 = Document. getelementbyid ("text1 ");
VaR cont;
Btextmode = newmode;
If (btextmode ){
Cont = text1.innerhtml;
Text1.innertext = cont;
}
Else {
Cont = text1.innertext;
Text1.innerhtml = cont;
}
}
// --> </SCRIPT>
</Head>
<Body>
<Div>
<Input id = "editmode" onclick = "setmode (this. Checked)" type = "checkbox">
View HTML Source code </Div>
<Div id = text1 name = text1>
<Object width = 500 Height = 300 classid = CLSID: 22d6f312-b0f6-11d0-94ab-0080c74c7e95>
<Param name = filename value?text=>
</Object>
</Div>
</Html>

Browse in IE6:

In IE7:

IE7 deletes all the param labels in the object, which makes us puzzled. When using innerhtml to obtain the object and the HTML code, it does not simply extract the original code, but is "modified. In IE6, The Modification result is that it gives us a fairly complete Param code, and IE7 deletes the param code. This difference brings a lot of trouble to compile code on our webpage. The solution is still being conceived. I hope you will discuss the problem together.

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.