javascript selection removeRange( )

removeRange( )NN 6 IE n/a DOM n/a  

removeRange(rangeReference)

  

Removes a single Range object from the current selection (not from the document tree). If you have a multiple-range selection, you can iterate through all Range objects, inspect each for some criterion, and delete the one(s) you want with the following sequence:

var oneRange;
var sel = window.getSelection( );
for (var i = 0; i< sel.rangeCount; i++) {
    oneRange = sel.getRangeAt(i);
    if (oneRange. someProperty == someDiscerningValue) {
        sel.removeRange(oneRange);
    }
}
 
Parameters
 
  • Reference to one of the Range objects previously added to the current selection.
 
Returned Value

None.


1756,Nickname,Homepage or email,Comments here,Add comment