JavaScript Reference/Javascript Methods/applyElement

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

"applyElement()" Example

   <source lang="javascript">
   

<script language="javascript"> function function1(){

var myElement = document.createElement("
");
  document.all.myBody.applyElement(myElement, "inside"); 

} </script> <body id="myBody"> <button onclick="function1();">Apply element</button> </body> </html>


     </source>
   
  


"applyElement()" 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> | | |<object>
      | | |<option>

      | | |<plaintext>

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

        "applyElement()" Syntax, Parameters and Note

        <source lang="javascript"> Note: Adds a new element as the parent or the child.

        Syntax:

        document.all.elementID.applyElement(param1, param2)

        Parameters: param1 Required; the new element to insert. param2 Optional; outside (the default; the element is the parent of the specified element) inside (the element is the child of the specified element).


        </source>

      |

      | |<textarea> <tfoot> |

      | |
      <thead> | | |<title>