개체에서 모든 애트리뷰트와 그 값들을 제거한다.
![]() | Script | object.clearAttributes() |
인수/파라메터는 없다.
반환값은 없다.
clearAttributes 메서드는 사용자가 정의한 HTML 애트리뷰트들을 제거한다.
id, style, script-only 속성들은 영향을 받지 않는다.
개체 | script | IE |
---|---|---|
a | a.clearAttributes() | IE5(win16,win32,unix,mac),IE5.5(ce) |
acronym | acronym.clearAttributes() | IE5(win16,win32,unix,mac),IE5.5(ce) |
address | address.clearAttributes() | IE5(win16,win32,unix,mac),IE5.5(ce) |
applet | applet.clearAttributes() | IE5(win16,win32,unix,mac),IE5.5(ce) |
area | area.clearAttributes() | IE5(win16,win32,unix,mac),IE5.5(ce) |
b | b.clearAttributes() | IE5(win16,win32,unix,mac),IE5.5(ce) |
base | base.clearAttributes() | IE5(win16,win32,unix,mac),IE5.5(ce) |
baseFont | baseFont.clearAttributes() | IE5(win16,win32,unix,mac),IE5.5(ce) |
bdo | bdo.clearAttributes() | IE5(win16,win32,unix,mac),IE5.5(ce) |
bgSound | bgSound.clearAttributes() | IE5(win16,win32,unix,mac),IE5.5(ce) |
big | big.clearAttributes() | IE5(win16,win32,unix,mac),IE5.5(ce) |
blockQuote | blockQuote.clearAttributes() | IE5(win16,win32,unix,mac),IE5.5(ce) |
body | body.clearAttributes() | IE5(win16,win32,unix,mac),IE5.5(ce) |
br | br.clearAttributes() | IE5(win16,win32,unix,mac),IE5.5(ce) |
button | button.clearAttributes() | IE5(win16,win32,unix,mac),IE5.5(ce) |
caption | caption.clearAttributes() | IE5(win16,win32,unix,mac),IE5.5(ce) |
center | center.clearAttributes() | IE5(win16,win32,unix,mac),IE5.5(ce) |
cite | cite.clearAttributes() | IE5(win16,win32,unix,mac),IE5.5(ce) |
code | code.clearAttributes() | IE5(win16,win32,unix,mac),IE5.5(ce) |
col | col.clearAttributes() | IE5(win16,win32,unix,mac),IE5.5(ce) |
colGroup | colGroup.clearAttributes() | IE5(win16,win32,unix,mac),IE5.5(ce) |
comment | comment.clearAttributes() | IE5(win16,win32,unix,mac),IE5.5(ce) |
custom | custom.clearAttributes() | IE5(win32,unix),IE5,5(ce) |
dd | dd.clearAttributes() | IE5(win16,win32,unix,mac),IE5.5(ce) |
del | del.clearAttributes() | IE5(win16,win32,unix,mac),IE5.5(ce) |
dfn | dfn.clearAttributes() | IE5(win16,win32,unix,mac),IE5.5(ce) |
dir | dir.clearAttributes() | IE5(win16,win32,unix,mac),IE5.5(ce) |
div | div.clearAttributes() | IE5(win16,win32,unix,mac),IE5.5(ce) |
dl | dl.clearAttributes() | IE5(win16,win32,unix,mac),IE5.5(ce) |
dt | dt.clearAttributes() | IE5(win16,win32,unix,mac),IE5.5(ce) |
em | em.clearAttributes() | IE5(win16,win32,unix,mac),IE5.5(ce) |
embed | embed.clearAttributes() | IE5(win16,win32,unix,mac),IE5.5(ce) |
fieldSet | fieldSet.clearAttributes() | IE5(win16,win32,unix,mac),IE5.5(ce) |
font | font.clearAttributes() | IE5(win16,win32,unix,mac),IE5.5(ce) |
form | form.clearAttributes() | IE5(win16,win32,unix,mac),IE5.5(ce) |
frame | frame.clearAttributes() | IE5(win16,win32,unix,mac),IE5.5(ce) |
frameSet | frameSet.clearAttributes() | IE5(win16,win32,unix,mac),IE5.5(ce) |
head | head.clearAttributes() | IE5(win16,win32,unix,mac),IE5.5(ce) |
hn | hn.clearAttributes() | IE5(win16,win32,unix,mac),IE5.5(ce) |
hr | hr.clearAttributes() | IE5(win16,win32,unix,mac),IE5.5(ce) |
html | html.clearAttributes() | IE5(win16,win32,unix,mac),IE5.5(ce) |
i | i.clearAttributes() | IE5(win16,win32,unix,mac),IE5.5(ce) |
iFrame | iFrame.clearAttributes() | IE5(win16,win32,unix,mac),IE5.5(ce) |
img | img.clearAttributes() | IE5(win16,win32,unix,mac),IE5.5(ce) |
button | button.clearAttributes() | IE5(win16,win32,unix,mac),IE5.5(ce) |
checkbox | checkbox.clearAttributes() | IE5(win16,win32,unix,mac),IE5.5(ce) |
FileUpload | FileUpload.clearAttributes() | IE5(win16,win32,unix,mac),IE5.5(ce) |
hidden | hidden.clearAttributes() | IE5(win16,win32,unix,mac),IE5.5(ce) |
image | image.clearAttributes() | IE5(win16,win32,unix,mac),IE5.5(ce) |
password | password.clearAttributes() | IE5(win16,win32,unix,mac),IE5.5(ce) |
radio | radio.clearAttributes() | IE5(win16,win32,unix,mac),IE5.5(ce) |
reset | reset.clearAttributes() | IE5(win16,win32,unix,mac),IE5.5(ce) |
submit | submit.clearAttributes() | IE5(win16,win32,unix,mac),IE5.5(ce) |
text | text.clearAttributes() | IE5(win16,win32,unix,mac),IE5.5(ce) |
ins | ins.clearAttributes() | IE5(win16,win32,unix,mac),IE5.5(ce) |
kbd | kbd.clearAttributes() | IE5(win16,win32,unix,mac),IE5.5(ce) |
label | label.clearAttributes() | IE5(win16,win32,unix,mac),IE5.5(ce) |
legend | legend.clearAttributes() | IE5(win16,win32,unix,mac),IE5.5(ce) |
li | li.clearAttributes() | IE5(win16,win32,unix,mac),IE5.5(ce) |
link | link.clearAttributes() | IE5(win16,win32,unix,mac),IE5.5(ce) |
listing | listing.clearAttributes() | IE5(win16,win32,unix,mac),IE5.5(ce) |
map | map.clearAttributes() | IE5(win16,win32,unix,mac),IE5.5(ce) |
marquee | marquee.clearAttributes() | IE5(win16,win32,unix,mac),IE5.5(ce) |
menu | menu.clearAttributes() | IE5(win16,win32,unix,mac),IE5.5(ce) |
nextID | nextID.clearAttributes() | IE5(win16,win32,unix,mac),IE5.5(ce) |
Object | Object.clearAttributes() | IE5(win16,win32,unix,mac),IE5.5(ce) |
ol | ol.clearAttributes() | IE5(win16,win32,unix,mac),IE5.5(ce) |
Option | Option.clearAttributes() | IE5(win16,win32,unix,mac),IE5.5(ce) |
p | p.clearAttributes() | IE5(win16,win32,unix,mac),IE5.5(ce) |
plainText | plainText.clearAttributes() | IE5(win16,win32,unix,mac),IE5.5(ce) |
pre | pre.clearAttributes() | IE5(win16,win32,unix,mac),IE5.5(ce) |
q | q.clearAttributes() | IE5(win16,win32,unix,mac),IE5.5(ce) |
s | s.clearAttributes() | IE5(win16,win32,unix,mac),IE5.5(ce) |
samp | samp.clearAttributes() | IE5(win16,win32,unix,mac),IE5.5(ce) |
script | script.clearAttributes() | IE5(win16,win32,unix,mac),IE5.5(ce) |
select | select.clearAttributes() | IE5(win16,win32,unix,mac),IE5.5(ce) |
small | small.clearAttributes() | IE5(win16,win32,unix,mac),IE5.5(ce) |
span | span.clearAttributes() | IE5(win16,win32,unix,mac),IE5.5(ce) |
strike | strike.clearAttributes() | IE5(win16,win32,unix,mac),IE5.5(ce) |
strong | strong.clearAttributes() | IE5(win16,win32,unix,mac),IE5.5(ce) |
sub | sub.clearAttributes() | IE5(win16,win32,unix,mac),IE5.5(ce) |
sup | sup.clearAttributes() | IE5(win16,win32,unix,mac),IE5.5(ce) |
table | table.clearAttributes() | IE5(win16,win32,unix,mac),IE5.5(ce) |
tBody | tBody.clearAttributes() | IE5(win16,win32,unix,mac),IE5.5(ce) |
td | td.clearAttributes() | IE5(win16,win32,unix,mac),IE5.5(ce) |
textArea | textArea.clearAttributes() | IE5(win16,win32,unix,mac),IE5.5(ce) |
tFoot | tFoot.clearAttributes() | IE5(win16,win32,unix,mac),IE5.5(ce) |
th | th.clearAttributes() | IE5(win16,win32,unix,mac),IE5.5(ce) |
tHead | tHead.clearAttributes() | IE5(win16,win32,unix,mac),IE5.5(ce) |
title | title.clearAttributes() | IE5(win16,win32,unix,mac),IE5.5(ce) |
tr | tr.clearAttributes() | IE5(win16,win32,unix,mac),IE5.5(ce) |
tt | tt.clearAttributes() | IE5(win16,win32,unix,mac),IE5.5(ce) |
u | u.clearAttributes() | IE5(win16,win32,unix,mac),IE5.5(ce) |
ul | ul.clearAttributes() | IE5(win16,win32,unix,mac),IE5.5(ce) |
var | var.clearAttributes() | IE5(win16,win32,unix,mac),IE5.5(ce) |
xmp | xmp.clearAttributes() | IE5(win16,win32,unix,mac),IE5.5(ce) |
![]() | clearAttributes 메서드⇒ | ![]() | ![]() ![]() ![]() |
tdObj | |
tdObj.attributes.length=8 0]id=tdObj 1]attribute1=true 2]attribute2=true 3]myname=trio 4]onclick=alert('클릭했다.'); 5]bgcolor=ffffaa 6]onmouseover=this.style.color='#0000FF'; 7]onmouseout=this.style.color='#000000'; |
단추를 클릭해 보라. |
이 예제는 clearAttributes 메서드를 사용하여 사용자가 정의한 추가된 attribute1, attribute2, myname 애트리뷰트를 제거하였다.
<SCRIPT>
function fnClear(){ tdObj.clearAttributes(); }
function showAttribs(bb){
leng=tdObj.attributes.length;
str='tdObj.attributes.length='+leng+'<BR>';
for (i=0;i< leng;i++){
// if ((i<10)||(i==40)||(i==73)||(i>(leng-6))) // 요약 보기
str+=i+']'+tdObj.attributes[i].name+'=<FONT color=blue>'+tdObj.attributes[i].value+'</FONT><BR>';
}
if (bb) showB.innerHTML=str;
else showA.innerHTML=str;
}
</SCRIPT>
<TABLE border=1>
<TR align=center>
<TD id="tdObj" attribute1="true" attribute2="true" myname="trio" onclick="alert('클릭했다.');" bgcolor="ffffaa"
onmouseover="this.style.color='#0000FF';" onmouseout="this.style.color='#000000';"><B>tdObj</B></TD>
<TD><INPUT type="button" value="Clear Attributes" onclick="fnClear();showAttribs(1)"></TD>
</TR>
<TR>
<TD id=showA style=white-space:nowrap></TD>
<TD id=showB style=white-space:nowrap>단추를 클릭해 보라.</TD>
</TR>
</TABLE>
<SCRIPT>showAttribs(0)</SCRIPT>
</DIV>
![]() | clearAttributes 메서드 | ⇒ | ![]() ![]() |
최종 수정: 07/05/2025 12:45:36 | ![]() All right reserved | 비정상적인 방식으로 프레임없이 페이지에 접속하면 자주 오류가 발생됩니다. 오류가 나면 정상적 접속으로 시도해 보세요. | http://koxo.com/lang/js/method/clearAttributes.html |