A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://webplatform.github.io/docs/dom/HTMLElement/clearAttributes below:

clearAttributes ยท WebPlatform Docs

clearAttributes

Method of dom/HTMLElementdom/HTMLElement

Syntax
var object = object.clearAttributes();
Return Value

Returns an object of type DOM NodeDOM Node

Type: HRESULT

If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code.

Type: HRESULT

If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code.

Examples

This example uses the clearAttributes method to remove user-defined attributes from an element.

<SCRIPT>
function fnClear(){
   oSource.children[0].clearAttributes();
}
</SCRIPT>
<SPAN ID=oSource>
<DIV
   ID="oDiv"
   ATTRIBUTE1="true"
   ATTRIBUTE2="true"
   onclick="alert('click');"
   onmouseover="this.style.color='#0000FF';"
   onmouseout="this.style.color='#000000';"
>
This is a sample <b>DIV</b> element.
</DIV>
</SPAN>
<INPUT
   TYPE="button"
   VALUE="Clear Attributes"
   onclick="fnClear()"
>

View live example

Notes Remarks

The clearAttributes method clears only persistent HTML attributes. The ID attribute, styles, and script-only properties are not affected.

Syntax Standards information

There are no standards that apply here.

Attributions

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4