Method of dom/HTMLElementdom/HTMLElement
Syntaxvar 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.
ExamplesThis 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()"
>
Notes Remarks
The clearAttributes method clears only persistent HTML attributes. The ID attribute, styles, and script-only properties are not affected.
Syntax Standards informationThere are no standards that apply here.
AttributionsMicrosoft Developer Network: [Windows Internet Explorer API reference Article]
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