JavaScript Reference/Javascript Methods/select

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

"select()" Example

   <source lang="javascript">
   

<html> <body> <script language="JavaScript"> function function1() {

   var m = document.body.createTextRange();
   m.findText(""test"");
   m.select(); 

} </script>

Search the "test" word in this paragraph

<button onclick="function1();">Find test</button> </body> </html>


     </source>
   
  


"select()" is applied to

   <source lang="javascript">

Names noted with an asterisk (*) are JavaScript properties only. +----------------+--------------------------------------------------------------+ | Applied_To |controlRange* TextRange | +----------------+--------------------------------------------------------------+

     </source>
   
  


"select()" Syntax, Parameters and Note

   <source lang="javascript">

Note: Highlight the specified object.

Syntax:

controlRangeName.select() textRangeName.select()


     </source>