[ http://blog.naver.com/acetious/80042249483 ]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=EUC-KR" />
<script language ="JavaScript">
function TestReset() {
alert(document.getElementById("test01").outerHTML);
alert(document.getElementById("test02").innerHTML);
}
</script>
</head>
<body>
<div id = "test01" >
This is DIV01 <input type = text value = "이름을 입력하세요">
</div>
<div id = "test02" >
This is DIV02 <input type = text value = "이름을 입력하세요">
</div>
<input type = "button" id = "name" value = "버튼1" onclick = "TestReset()">
</body>
</html>
[출처] innerHTML 과 outerHTML 의 차이 |작성자 남이
'Jsp_Html' 카테고리의 다른 글
[Jsp] JSTL(JSP Standard Tag Library) (0) | 2010.06.15 |
---|---|
[Jsp] JSTL강좌!!! (IBM) (0) | 2010.06.03 |
[Jsp] 내장객체 (0) | 2009.11.25 |
[Jsp] Session 사용하기 (0) | 2009.11.20 |
[Jsp] 캐쉬삭제 (0) | 2009.11.20 |