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

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

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

"clearAttributes()" Example

   <source lang="javascript">
   

<html> <body> <script language="JavaScript">

   function function1() {
       document.all.myP.clearAttributes(); 
   } 

</script>

This text has the style and id attributes.

This text has the style and id1 attributes.

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


     </source>
   
  


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

        "clearAttributes()" Syntax, Parameters and Note

        <source lang="javascript"> Note: Removes all attributes, except name and id, from an element.

        Syntax:

        document.all.elementID.clearAttributes()


        </source>

      |

      | |<textarea> <tfoot> |

      | |
      <thead> | | |<title>