Sets or retrieves a value indicating whether arbitrary variables can be created within the object.
What's New for Microsoft® Internet Explorer 6
This property now applies to the
attribute object.
dhtml语法
object.expando [ = bExpand ]
DHTML可能的值
bExpand | Boolean that
specifies or receives one of the following values.true | Default. Creation of arbitrary variables is allowed. | false | Creation of arbitrary variables is not allowed. |
|
The property is read/write.
The property has a default value of
true.
Expressions can be used in place of the preceding value(s), as of Microsoft® Internet Explorer 5. For more information, see about dynamic properties.
remarks
you can extend the properties on an object by creating arbitrary properties with values. you should be careful, however, because you can unintentionally set a property value when scripting in a case-sensitive language such as microsoft jscript®. for example, if the property value is bordercolor and you type the value "bordercolor = 'blue'", you have, in fact, created another property on the style object called bordercolor with the value 'blue'. if you query the value of the property, the value "blue" is returned. however, the borders for the element do not turn blue.
microsoft visual basic® scripting edition (vbscript) does not support expando properties on its native language objects, nor does it cause internet explorer to create expando properties on its objects. internet explorer supports creation of expando properties on its objects, in any language, through setattribute.
setting the expando property of the document object to false precludes the functionality of all expandos within the document.
Examples
The following example demonstrates that, by setting the expando property of the document object to false, the document ignores the unselectable expando on the span and allows you to select the text.
<HTML>
<HEAD>
<SCRIPT>
//Set the expando property to false.
document.expando = false;
</SCRIPT>
</HEAD>
<BODY>
<DIV>
<SPAN id="oSpan" unselectable="on">
This text should be selectable.</SPAN>
</DIV>
</BODY>
</HTML>
This feature requires Microsoft® Internet Explorer 4.0 or later. Click the following icon to install the latest version. Then reload this page to view the sample.
Using the previous example and setting the expando property of the document object to true, the span will not allow you to select the text.
<HTML>
<HEAD>
<SCRIPT>
//Set the expando property to true.
document.expando = true;
</SCRIPT>
</HEAD>
<BODY>
<DIV>
<SPAN id="oSpan" unselectable="on">
This text should not be selectable.</SPAN>
</DIV>
</BODY>
</HTML>
This feature requires Microsoft® Internet Explorer 4.0 or later. Click the following icon to install the latest version. Then reload this page to view the sample.
是否符合公共标准
There is no public standard that applies to this property.
Applies To