JavaScript Reference/Javascript Methods/applyElement — различия между версиями

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

Текущая версия на 08:22, 26 мая 2010

"applyElement()" Example

    
<script language="javascript">
function function1(){
   var myElement = document.createElement("<div style="width:600; height:200;background-color:blue;"></div>");
   document.all.myBody.applyElement(myElement, "inside"); 
} 
</script>
<body id="myBody">
<button onclick="function1();">Apply element</button>
</body>
</html>



"applyElement()" is applied to

+----------------+--------------------------------------------------------------+
| Applied_To     |<a>                             <acronym>                     |
|                |<address>                       <applet>                      |
|                |<area>                          <b>                           |
|                |<base>                          <basefont>                    |
|                |<bdo>                           <bgsound>                     |
|                |<big>                           <blockquote>                  |
|                |<body>                          <br>                          |
|                |<button>                        <caption>                     |
|                |<center>                        <cite>                        |
|                |<code>                          <col>                         |
|                |<colgroup>                      <comment>                     |
|                |<custom>                        <dd>                          |
|                |<del>                           <dfn>                         |
|                |<dir>                           <div>                         |
|                |<dl>                            <dt>                          |
|                |<em>                            <embed>                       |
|                |<fieldset>                      <font>                        |
|                |<form>                          <frame>                       |
|                |<frameset>                      <head>                        |
|                |<hn>                            <hr>                          |
|                |<html>                          <i>                           |
|                |<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">           |
|                |<ins>                           <kbd>                         |
|                |<label>                         <legend>                      |
|                |<li>                            <link>                        |
|                |<listing>                       <map>                         |
|                |<marquee>                       <menu>                        |
|                |<object>                        <ol>                          |
|                |<option>                        <p>                           |
|                |<plaintext>                     <pre>                         |
|                |<q>                             <s>                           |
|                |<samp>                          <script>                      |
|                |<select>                        <small>                       |
|                |<span>                          <strike>                      |
|                |<strong>                        <sub>                         |
|                |<sup>                           <table>                       |
|                |<tbody>                         <td>                          |
|                |<textarea>                      <tfoot>                       |
|                |<th>                            <thead>                       |
|                |<title>                         <tr>                          |
|                |<tt>                            <u>                           |
|                |<ul>                            <var>                         |
|                |<xmp>                                                         |
+----------------+--------------------------------------------------------------+



"applyElement()" Syntax, Parameters and Note

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).