JavaScript Reference/Javascript Properties/parentTextEdit

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

"parentTextEdit" Example

   <source lang="javascript">
   

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

  var choose, range;
  for (var i = 0; i < document.forms[0].choose.length; i++) {
     if (document.forms[0].choose[i].checked) {
        choose = document.forms[0].choose[i].value;
        break; 
     }
  }
  var x = window.event.clientX;
  var y = window.event.clientY;
  if (window.event.srcElement.parentTextEdit) {
     range = window.event.srcElement.parentTextEdit.createTextRange()
      range.collapse();
      range.moveToPoint(x, y);
      range.expand(choose);
      range.select();
    }

} </script> <form> <input type="radio" name="choose" value="character" checked>character <input type="radio" name="choose" value="word">word <input type="radio" name="choose" value="sentence">sentence </form>

Some text.

</body> </html>


     </source>
   
  


"parentTextEdit" is applied to

   <source lang="javascript">

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

| |
|

| |<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> | | |<meta> <nobr> | | |<object>
      | | |<option>

      | | |<plaintext>

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

        "parentTextEdit" Syntax and Note

        <source lang="javascript"> Note: Read-only property. Returns a reference to the element"s outermost container that can create a text range.

        Syntax:

        document.all.elementID.parentTextEdit


        </source>

      |

      | |<textarea> <tfoot> |

      | |
      <thead> | | |<title>