JavaScript Reference/Javascript Methods/clearAttributes — различия между версиями
Admin (обсуждение | вклад) м (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>| | | | | |
| |<dir><col> | | |<colgroup> <comment> | | |<custom>
| | | || | |
- | | | <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>
| | |<textarea> <tfoot> |
| |<thead> | | |<title> | | | | | | | | |<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>