개체의 childNodes 컬렉션에서 마지막 자식 개체을 반환한다.

Script[oVal=]object.lastChild
HTML없음
인수
object : (개체)

필수적인 요소 object는 이 속성이 적용되는 엘레멘트 개체이다.

oVal : (속성 개체)
선택적인 인수 lastChild 속성은 개체의 childNodes에서 반환받은 마지막 자식 엘레멘트 개체를 참조한다.

이 속성은 읽기전용이며 디폴트값은 없다.

적용
개체scriptHTML규격IE
a[oVal=]a.lastChild없음없음IE5(win16,win32,unix,mac),IE5.5(ce)
acronym[oVal=]acronym.lastChild없음없음IE5(win16,win32,unix,mac),IE5.5(ce)
address[oVal=]address.lastChild없음없음IE5(win16,win32,unix,mac),IE5.5(ce)
applet[oVal=]applet.lastChild없음없음IE5(win16,win32,unix,mac),IE5.5(ce)
area[oVal=]area.lastChild없음없음IE5(win16,win32,unix,mac),IE5.5(ce)
attribute[oVal=]attribute.lastChild없음없음IE6(win32)
b[oVal=]b.lastChild없음없음IE5(win16,win32,unix,mac),IE5.5(ce)
base[oVal=]base.lastChild없음없음IE5(win16,win32,unix,mac),IE5.5(ce)
baseFont[oVal=]baseFont.lastChild없음없음IE5(win16,win32,unix,mac),IE5.5(ce)
bdo[oVal=]bdo.lastChild없음없음IE5(win16,win32,unix,mac),IE5.5(ce)
big[oVal=]big.lastChild없음없음IE5(win16,win32,unix,mac),IE5.5(ce)
blockQuote[oVal=]blockQuote.lastChild없음없음IE5(win16,win32,unix,mac),IE5.5(ce)
body[oVal=]body.lastChild없음없음IE5(win16,win32,unix,mac),IE5.5(ce)
button[oVal=]button.lastChild없음없음IE5(win16,win32,unix,mac),IE5.5(ce)
caption[oVal=]caption.lastChild없음없음IE5(win16,win32,unix,mac),IE5.5(ce)
center[oVal=]center.lastChild없음없음IE5(win16,win32,unix,mac),IE5.5(ce)
cite[oVal=]cite.lastChild없음없음IE5(win16,win32,unix,mac),IE5.5(ce)
code[oVal=]code.lastChild없음없음IE5(win16,win32,unix,mac),IE5.5(ce)
col[oVal=]col.lastChild없음없음IE5(win16,win32,unix,mac),IE5.5(ce)
colGroup[oVal=]colGroup.lastChild없음없음IE5(win16,win32,unix,mac),IE5.5(ce)
comment[oVal=]comment.lastChild없음없음IE5(win16,win32,unix,mac),IE5.5(ce)
dd[oVal=]dd.lastChild없음없음IE5(win16,win32,unix,mac),IE5.5(ce)
del[oVal=]del.lastChild없음없음IE5(win16,win32,unix,mac),IE5.5(ce)
dfn[oVal=]dfn.lastChild없음없음IE5(win16,win32,unix,mac),IE5.5(ce)
dir[oVal=]dir.lastChild없음없음IE5(win16,win32,unix,mac),IE5.5(ce)
div[oVal=]div.lastChild없음없음IE5(win16,win32,unix,mac),IE5.5(ce)
dl[oVal=]dl.lastChild없음없음IE5(win16,win32,unix,mac),IE5.5(ce)
dt[oVal=]dt.lastChild없음없음IE5(win16,win32,unix,mac),IE5.5(ce)
em[oVal=]em.lastChild없음없음IE5(win16,win32,unix,mac),IE5.5(ce)
embed[oVal=]embed.lastChild없음없음IE5(win16,win32,unix,mac),IE5.5(ce)
fieldSet[oVal=]fieldSet.lastChild없음없음IE5(win16,win32,unix,mac),IE5.5(ce)
font[oVal=]font.lastChild없음없음IE5(win16,win32,unix,mac),IE5.5(ce)
form[oVal=]form.lastChild없음없음IE5(win16,win32,unix,mac),IE5.5(ce)
frame[oVal=]frame.lastChild없음없음IE5(win16,win32,unix,mac),IE5.5(ce)
frameSet[oVal=]frameSet.lastChild없음없음IE5(win16,win32,unix,mac),IE5.5(ce)
head[oVal=]head.lastChild없음없음IE5(win16,win32,unix,mac),IE5.5(ce)
hn[oVal=]hn.lastChild없음없음IE5(win16,win32,unix,mac),IE5.5(ce)
hr[oVal=]hr.lastChild없음없음IE5(win16,win32,unix,mac),IE5.5(ce)
html[oVal=]html.lastChild없음없음IE5(win16,win32,unix,mac),IE5.5(ce)
i[oVal=]i.lastChild없음없음IE5(win16,win32,unix,mac),IE5.5(ce)
iFrame[oVal=]iFrame.lastChild없음없음IE5(win16,win32,unix,mac),IE5.5(ce)
img[oVal=]img.lastChild없음없음IE5(win16,win32,unix,mac),IE5.5(ce)
button[oVal=]button.lastChild없음없음IE5(win16,win32,unix,mac),IE5.5(ce)
checkbox[oVal=]checkbox.lastChild없음없음IE5(win16,win32,unix,mac),IE5.5(ce)
FileUpload[oVal=]FileUpload.lastChild없음없음IE5(win16,win32,unix,mac),IE5.5(ce)
image[oVal=]image.lastChild없음없음IE5(win16,win32,unix,mac),IE5.5(ce)
password[oVal=]password.lastChild없음없음IE5(win16,win32,unix,mac),IE5.5(ce)
radio[oVal=]radio.lastChild없음없음IE5(win16,win32,unix,mac),IE5.5(ce)
reset[oVal=]reset.lastChild없음없음IE5(win16,win32,unix,mac),IE5.5(ce)
submit[oVal=]submit.lastChild없음없음IE5(win16,win32,unix,mac),IE5.5(ce)
text[oVal=]text.lastChild없음없음IE5(win16,win32,unix,mac),IE5.5(ce)
ins[oVal=]ins.lastChild없음없음IE5(win16,win32,unix,mac),IE5.5(ce)
kbd[oVal=]kbd.lastChild없음없음IE5(win16,win32,unix,mac),IE5.5(ce)
label[oVal=]label.lastChild없음없음IE5(win16,win32,unix,mac),IE5.5(ce)
legend[oVal=]legend.lastChild없음없음IE5(win16,win32,unix,mac),IE5.5(ce)
li[oVal=]li.lastChild없음없음IE5(win16,win32,unix,mac),IE5.5(ce)
link[oVal=]link.lastChild없음없음IE5(win16,win32,unix,mac),IE5.5(ce)
listing[oVal=]listing.lastChild없음없음IE5(win16,win32,unix,mac),IE5.5(ce)
map[oVal=]map.lastChild없음없음IE5(win16,win32,unix,mac),IE5.5(ce)
marquee[oVal=]marquee.lastChild없음없음IE5(win16,win32,unix,mac),IE5.5(ce)
menu[oVal=]menu.lastChild없음없음IE5(win16,win32,unix,mac),IE5.5(ce)
nextID[oVal=]nextID.lastChild없음없음IE5(win16,win32,unix,mac),IE5.5(ce)
ol[oVal=]ol.lastChild없음없음IE5(win16,win32,unix,mac),IE5.5(ce)
Option[oVal=]Option.lastChild없음없음IE5(win16,win32,unix,mac),IE5.5(ce)
p[oVal=]p.lastChild없음없음IE5(win16,win32,unix,mac),IE5.5(ce)
plainText[oVal=]plainText.lastChild없음없음IE5(win16,win32,unix,mac),IE5.5(ce)
pre[oVal=]pre.lastChild없음없음IE5(win16,win32,unix,mac),IE5.5(ce)
q[oVal=]q.lastChild없음없음IE5(win16,win32,unix,mac),IE5.5(ce)
s[oVal=]s.lastChild없음없음IE5(win16,win32,unix,mac),IE5.5(ce)
samp[oVal=]samp.lastChild없음없음IE5(win16,win32,unix,mac),IE5.5(ce)
script[oVal=]script.lastChild없음없음IE5(win16,win32,unix,mac),IE5.5(ce)
select[oVal=]select.lastChild없음없음IE5(win16,win32,unix,mac),IE5.5(ce)
small[oVal=]small.lastChild없음없음IE5(win16,win32,unix,mac),IE5.5(ce)
span[oVal=]span.lastChild없음없음IE5(win16,win32,unix,mac),IE5.5(ce)
strike[oVal=]strike.lastChild없음없음IE5(win16,win32,unix,mac),IE5.5(ce)
strong[oVal=]strong.lastChild없음없음IE5(win16,win32,unix,mac),IE5.5(ce)
sub[oVal=]sub.lastChild없음없음IE5(win16,win32,unix,mac),IE5.5(ce)
sup[oVal=]sup.lastChild없음없음IE5(win16,win32,unix,mac),IE5.5(ce)
table[oVal=]table.lastChild없음없음IE5(win16,win32,unix,mac),IE5.5(ce)
tBody[oVal=]tBody.lastChild없음없음IE5(win16,win32,unix,mac),IE5.5(ce)
td[oVal=]td.lastChild없음없음IE5(win16,win32,unix,mac),IE5.5(ce)
textArea[oVal=]textArea.lastChild없음없음IE5(win16,win32,unix,mac),IE5.5(ce)
tFoot[oVal=]tFoot.lastChild없음없음IE5(win16,win32,unix,mac),IE5.5(ce)
th[oVal=]th.lastChild없음없음IE5(win16,win32,unix,mac),IE5.5(ce)
tHead[oVal=]tHead.lastChild없음없음IE5(win16,win32,unix,mac),IE5.5(ce)
title[oVal=]title.lastChild없음없음IE5(win16,win32,unix,mac),IE5.5(ce)
tr[oVal=]tr.lastChild없음없음IE5(win16,win32,unix,mac),IE5.5(ce)
tt[oVal=]tt.lastChild없음없음IE5(win16,win32,unix,mac),IE5.5(ce)
u[oVal=]u.lastChild없음없음IE5(win16,win32,unix,mac),IE5.5(ce)
ul[oVal=]ul.lastChild없음없음IE5(win16,win32,unix,mac),IE5.5(ce)
var[oVal=]var.lastChild없음없음IE5(win16,win32,unix,mac),IE5.5(ce)
xmp[oVal=]xmp.lastChild없음없음IE5(win16,win32,unix,mac),IE5.5(ce)
참조
firstChild lastChild nextSibling previousSibling childNodes


property
lastChild 속성
lastChild</b> 속성
예제
이전페이지로페이지 맨위로페이지 맨아래로

BODY lastChild 속성 예제

bodyObj.lastChild=[object HTMLDivElement]
bodyObj.lastChild.nodeName=DIV
<BODY id=bodyObj>

<SCRIPT>
document.write('bodyObj.lastChild='+bodyObj.lastChild+'<BR>bodyObj.lastChild.nodeName='+bodyObj.lastChild.nodeName)
</SCRIPT>

OL firstChild, lastChild 속성 예제

  1. 항목 번호 1
  2. 항목 번호 2
  3. 항목 번호 3
olObj.firstChild=[object Text]
olObj.firstChild.nodeName=#text
olObj.firstChild.id=undefined
olObj.firstChild.innerText=undefined

olObj.lastChild=[object HTMLLIElement]
olObj.lastChild.nodeName=LI
olObj.lastChild.id=liObj3
olObj.lastChild.innerText=항목 번호 3
<OL ID=olObj>
<LI id='liObj1'>항목 번호 1
<LI id='liObj2'>항목 번호 2
<LI id='liObj3'>항목 번호 3
</OL>
<SCRIPT>
br='<BR>';
document.write('olObj.firstChild='+olObj.firstChild+br)
document.write('olObj.firstChild.nodeName='+olObj.firstChild.nodeName+br)
document.write('olObj.firstChild.id='+olObj.firstChild.id+br)
document.write('olObj.firstChild.innerText='+olObj.firstChild.innerText+br+br)
document.write('olObj.lastChild='+olObj.lastChild+br)
document.write('olObj.lastChild.nodeName='+olObj.lastChild.nodeName+br)
document.write('olObj.lastChild.id='+olObj.lastChild.id+br)
document.write('olObj.lastChild.innerText='+olObj.lastChild.innerText+br)
</SCRIPT>

property
lastChild 속성
lastChild</b> 속성
견본
이전페이지로페이지 맨위로페이지 맨아래로
property
lastChild 속성
견본예제
이전페이지로페이지 맨위로
최종 수정:
04/05/2025 17:23:50
KoXo Homepage
All right reserved
비정상적인 방식으로 프레임없이 페이지에 접속하면 자주 오류가 발생됩니다.
오류가 나면 정상적 접속으로 시도해 보세요.
http://koxo.com/lang/js/property/lastChild.html