JavaScript Reference/Javascript Methods/inRange

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

"inRange()" Example

   <source lang="javascript">
   

<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>


     </source>
   
  


"inRange()" is applied to

   <source lang="javascript">

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

     </source>
   
  


"inRange()" Syntax, Parameters and Note

   <source lang="javascript">

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. 
   
     
     </source>