Export (0) Print
Expand All
Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.
This topic has not yet been rated - Rate this topic

controlRange property

A collection of elements returned by the createControlRange or createRange method.

Syntax

JavaScript

range = object.controlRange

Property values

Type: IUnknown

Array of elements created with the createControlRange method.

Standards information

There are no standards that apply here.

Remarks

Instead of using the collection's item method, you can use an index to directly access an element in the collection. For example, the element returned from the collection represented by oColl(0) is the same as the element returned by oColl.item(0).

Examples

This example demonstrates how to use the createRange method to retrieve the controlRange collection.


...
function fnChangeFontFamily    (){
  if (document.selection.type == "Control"){ 
    var oControlRange = document.selection.createRange();
    for (i = 0; i < oControlRange.length; i++)
      if (oControlRange(i).tagName != "img")
       oControlRange(i).style.fontFamily=event.srcElement.style.fontFamily;
  }
}
...
<!-- Text Font-Family Controls  -->
<span  onclick="fnChangeFontFamily();">
    <div style="height: 25px; cursor:hand; font-family:times; 
        font-size:14pt; font-weight:normal; color:white">Times</div>
    <div style="height: 25px; cursor:hand; font-family:arial;   
        font-size:14pt; font-weight:normal; color:white">Arial</div>
    <div style="height: 25px; cursor:hand; font-family:georgia; 
        font-size:14pt; font-weight:normal; color:white">Georgia</div>
    <div style="height: 25px; cursor:hand; font-family:verdana; 
        font-size:14pt; font-weight:normal; color:white">Verdana</div>
</span><br/>
...

See also

Reference
createControlRange
createRange

 

 

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft. All rights reserved.