A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://webplatform.github.io/docs/dom/HTMLElement/controlRange below:

controlRange · WebPlatform Docs

controlRange

Property of dom/HTMLElementdom/HTMLElement

Syntax
var result = element.controlRange;
element.controlRange = value;
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/>
...

View live example

Notes 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). The controlRange collection is available as of Microsoft Internet Explorer 5.

Syntax Standards information

There are no standards that apply here.

Attributions

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4