JavaScript Reference/Javascript Methods/getAdjacentText

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

"getAdjacentText()" Example

   <source lang="javascript">
   

<html> <body>

This is some Adjacent Text example

<input type="button" value="Find text"

      onclick="alert(myBold.getAdjacentText("beforeBegin"));">

</body> </html>


     </source>
   
  


"getAdjacentText()" is applied to

   <source lang="javascript">

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

| |
<body> |

| |
<button> |

| |
|

| | | | |<col> <colgroup> | | |<comment> <custom> | | |

| | | <dir> |

| |
|

| |

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

| |
<html> |

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

| |<legend>
  • | | |<link> <listing> | | |<map> <marquee> | | |<menu> <object> | | |
      <option> | | |

      <plaintext> | | |

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

        "getAdjacentText()" Syntax, Parameters and Note

        <source lang="javascript"> Note: Returns the text in the specified position.

        Syntax:

        document.all.elementID.getAdjacentText(param1)

        Parameters: param1 afterBegin (just after the beginning of the element), beforeEnd (just before the end of the element), afterEnd (just after the end of the element).


        </source>

      <textarea> | | |<tfoot> |

      | |<thead> <title> |

      | |