www.fgks.org   »   [go: up one dir, main page]

Click to Rate and Give Feedback
SELECTION Attribute | selection Property

Sets or gets a string value that indicates whether the content can be selected with the mouse or keyboard.

Syntax

HTML<HTA:APPLICATION SELECTION = sSelection... >
Scripting[ sSelection = ] HTA:APPLICATION.selection

Possible Values

sSelection A String that specifies one of the following values.
yesDefault. Content can be selected with the mouse or keyboard.
noContent cannot be selected with the mouse or keyboard.

The property is read-only. The property has a default value of yes.

Remarks

Note  The selection property is read-only; however, the SELECTION attribute can be used to set the initial value.

Set the SELECTION attribute to no to prevent the context menu from displaying. If you set the CONTEXTMENU attribute to yes, it has no effect in this case.

Note   The use of content-editable elements overrides the selection property. When the contentEditable property is set to true anywhere in an HTML Application (HTA), any object can be selected.

Example

This example shows how to get the selection property.

<HTML>
<HEAD>
<HTA:APPLICATION 
 ID=oHTA 
 CONTEXTMENU="yes"
 SELECTION="no"/>
<TITLE>HTA Properties</TITLE>
<STYLE>
BODY {font-size: 8pt; font-family: Arial;}
</STYLE>
</HEAD>

<SCRIPT>
function readFun()
{
alert("The selection property is set to:  " + oHTA.selection);
}
</SCRIPT>

<BODY> 
<P>Read the property: 
<INPUT TYPE="button"  VALUE="Test selection value" />
</P>
</BODY>
</HTML>

Standards Information

There is no public standard that applies to this property.

Applies To

HTA:APPLICATION

See Also

contentEditable
Tags What's this?: Add a tag
Community Content
 
Add Community Content
© 2008 Microsoft Corporation. All rights reserved. Terms of Use  |  Trademarks  |  Privacy Statement
Page view tracker
DCSIMG