JavaScript Reference/Javascript Methods/removeAttributeNode

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

"removeAttributeNode()" Example

   <source lang="javascript">
   

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

   var m = document.getElementById("myDiv").getAttributeNode("id");
   alert("The value of the attributeNode is: "+"""+m.value+""");
   var n = document.all.myDiv.removeAttributeNode(m);
   alert("The attribute node has been removed");

} </script>

This is a div element

<input type="button" value="Get id attribute node value" onclick="function1();"> </body> </html>


     </source>
   
  


"removeAttributeNode()" 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> <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"> | | |<isindex> | | |<label> <legend> |

| |
  • <link> | | |<listing> <map> | | |<marquee> <menu> | | |<meta> <nobr> | | |<noframes> <noscript> | | |<object>
      | | |<optgroup> <option> | | |

      <param> | | |<plaintext>

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

        "removeAttributeNode()" Syntax, Parameters and Note

        <source lang="javascript"> Note: Removes the given attribute node from the element.

        Syntax:

        document.getElementById("elementID").removeAttributeNode(param1) document.all.elementID.removeAttributeNode(param1) // IE only Parameters: param1 Required; the name of the attribute to be removed.


        </source>

      <textarea> | | |<tfoot> |

      | |<thead> <title> |

      | |