JavaScript Reference/Javascript Methods/inRange

Материал из Web эксперт
Перейти к: навигация, поиск

"inRange()" Example

    
<html>
<body>
<script language="JavaScript">
function function1() {
   var myText = document.body.createTextRange();
   var myText2 = document.all.myText.createTextRange();
   alert(myText.inRange(myText2)); 
} 
</script>
<textarea id="myText" style="width:600; height:100;">Sample textarea text</textarea>
<button onclick="function1();">InRange</button>
</body>
</html>



"inRange()" is applied to

+----------------+--------------------------------------------------------------+
| Applied_To     |TextRange                                                     |
+----------------+--------------------------------------------------------------+



"inRange()" Syntax, Parameters and Note

Note:
Is the specified range inside another range. 
Returns true or false.
    
Syntax:
    
textRangeName.inRange(param1)
Parameters:
    param1   Required; the text range that may or may not be contained 
                       within textRangeName.