JavaScript Reference/Javascript Methods/mergeAttributes

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

"mergeAttributes()" Example

   <source lang="javascript">
   

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

   myDiv2.mergeAttributes(myDiv1);

} </script>

<button onclick="function1();">Merge attributes</button> </body> </html>


     </source>
   
  


"mergeAttributes()" 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>

        "mergeAttributes()" Syntax, Parameters and Note

        <source lang="javascript"> Note: Copies all attributes (except id and name) from one element to another.

        Syntax:

        document.all.elementID.mergeAttributes(param1, param2) Parameters: param1 Required; the from element. param2 Optional; true or false, indicating whether or not the id of the element is preserved.


        </source>

      |

      | |<textarea> <tfoot> |

      | |
      <thead> | | |<title>