[转]selection Object
Represents the active selection, which is a highlighted block of text or other elements in the document that a user or a script can carry out some action on.
Members Table
The following table lists the members exposed by the selection object.
Attributes/Properties
Property Description type Retrieves the type of selection. typeDetail Retrieves the name of the selection type. Behaviors
Behavior Description time2 Provides an active timeline for an HTML element or group of elements. Collections
Events
Event Description ontimeerror Fires whenever a time-specific error occurs, usually as a result of setting a property to an invalid value. Methods
Method Description clear Clears the contents of the selection. createRange Creates a TextRange object from the current text selection, or a controlRange collection from a control selection. createRangeCollection Creates a TextRange object collection from the current selection. empty Cancels the current selection, sets the selection type to none, and sets the item property to null.Prototypes
Object Description Selection Constructor ![]()
Defines the properties and methods inherited by objects in the Selection Constructor prototype chain.
Remarks
You can use the selection object as input from the user to identify which portion of the document to act on, or as output to the user to show the results of an action.
Users and scripts can create selections. Users create selections by dragging the mouse over a portion of the document. Scripts create selections by calling the select method on a text range or similar object. To get the active selection, apply the selection keyword to the document object. To carry out work on a selection, create a text range object from the selection using the createRange method.
A document can have only one selection at a time. The selection has a type that determines whether it is empty or contains a block of text or elements. Although an empty selection contains nothing, you can use it to mark a position in the document.
Standards Information
There is no public standard that applies to this object.
http://msdn.microsoft.com/en-us/library/ms535869(v=VS.85).aspx
- ·IE对CSS样式表的限制..
- ·HTML 5 WebSocket J..
- ·html5 websocket 通..
- ·Firefox上传文件获取..
- ·javascript获取file..
- ·URL转码方法及不能被..
- ·IE/Firefox/W3C浏览..
- ·CLIP: rect 是什么?
- flash/flex/fcs/AIR(752)
- Asp.Net/C#/WCF(598)
- 操作系统及应用软件(376)
- JavaScript/Ajax(330)
- SQL及数据库(134)
- 黑客技术(115)
- Asp/VBScript(111)
- HTML/WML/CSS兼容/XML(102)
- PHP/apache/Perl(96)
- 网站排名及优化(96)
- 其他(75)
- showbo日志(66)
- lucene.net/分词技术(33)
- 计算机网络(26)
- 机械重工(26)
- C#设计模式(25)
- Google Maps开发(17)
- 日语学习(15)
- Canvas/VML/SVG(13)
- linux(11)
- 游戏开发(8)
- 正则表达式(5)
- Jsp/Java(4)
