JavaScript Reference/Javascript Methods/setActive

Материал из Web эксперт
Версия от 11:22, 26 мая 2010; Admin (обсуждение | вклад) (1 версия)
(разн.) ← Предыдущая | Текущая версия (разн.) | Следующая → (разн.)
Перейти к: навигация, поиск

"setActive()" Example

   <source lang="javascript">
   

<html> <body> <script language="JavaScript">

   function function1() {
       document.all.myTextArea.setActive();
   }

</script> <textarea id="myTextArea">Some text</textarea> <input type="button"

      value="Insert the cursor inside the textarea" 
      onclick="function1();">

</body> </html>


     </source>
   
  


"setActive()" is applied to

   <source lang="javascript">

+----------------+--------------------------------------------------------------+ | Applied_To |<a> <acronym> | | |<address> <applet> | | |<area> | | | |

| |
<body> |

| |<button> |

| |
|

| |<custom>

| | | <dir> |

| |
|

| |document

| | | <embed> | | |<fieldset> | | |<form> <frame> | | |<frameset> <hn> |

| |
|

| |<iframe> <img> | | |<input type="button"> <input type="checkbox"> | | |<input type="file"> <input type="hidden"> | | |<input type="image"> <input type="password"> | | |<input type="radio"> <input type="reset"> | | |<input type="submit"> <input type="text"> | | | <isindex> | | | <label> |

| |<legend>
  • | | |<listing> <marquee> | | |<menu> <object> | | |

      | | |<plaintext>

                               |
      |                |                                                       |
      |                |                                                     |
      |                |                          <select>                      |
      |                |                                                 |
      |                |                                              |
      |                |                                                    |
      |                |                         <tbody>                       |
      |                |                          |
      |                |                                                       |
      |                |
        | | |window <xmp> | +----------------+--------------------------------------------------------------+ </source>

        "setActive()" Syntax, Parameters and Note

        <source lang="javascript"> Note: Changes an element"s status to active, giving it the focus.

        Syntax:

        document.all.elementID.setActive()


        </source>

      <textarea> | | |<tfoot> | | |<thead>