Microsoft KB Archive/812417

= PRB: outerHTML Property of HTML Element Does Not Display the Default Attribute =

Article ID: 812417

Article Last Modified on 11/17/2003

-

APPLIES TO


 * Microsoft Internet Explorer (Programming) 5.5 SP2
 * Microsoft Internet Explorer (Programming) 6.0
 * Microsoft Internet Explorer (Programming) 6 (SP1)

-



SYMPTOMS
Microsoft Internet Explorer may remove the type property when it returns the outerHTML property for either of the following HTML elements:
 * INPUT
 * BUTTON



CAUSE
By default, the type property of an INPUT element is text. By default, the type property of a BUTTON element is button. Internet Explorer can detect the default property of an HTML element after it detects the type of the element. Internet Explorer omits the default property when the outerHTML property of the element is retrieved, so outerHTML does not display the default property.



STATUS
This behavior is by design.



MORE INFORMATION
To reproduce the behavior, paste the following code in an HTML file, and then open it in Internet Explorer:  

function grabText {      var txtHTML = document.all(&quot;Text1&quot;).outerHTML; var btnHTML = document.all(&quot;Button1&quot;).outerHTML; alert(&quot;The outerHTML of the textbox is: \t&quot; + txtHTML            + &quot;\n\nThe outerHTML of the button is: \t&quot; + btnHTML); }   

  Button  

Keywords: kbdhtml kbprb KB812417

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.