● document객체의 프로퍼티 > SCRIPT

본문 바로가기

사이트 내 전체검색

뒤로가기 SCRIPT

● document객체의 프로퍼티

본문

<body style="background-color:yellow; color:blue;" onload="printProperties()">


<h3>document 주요 프로퍼티</h3>

<hr>

<a href="http://www.naver.com">네이버</a>

<div>div 영역입니다.</div>

<input id="input2" type="text" value="여기에 포커스 있음">


<script>

var text = "문서 로딩 중일때 readyState = "+ document.readyState +"\n";


function printProperties(){

document.getElementById("input2").focus();


text += "1. location = "+document.location+" \n";

text += "2. URL = "+document.URL+" \n";

text += "3. title = "+document.title+" \n";

text += "4. head의 id = "+document.head.id+" \n";

text += "5. body color = "+document.body.style.color+" \n";

text += "6. domain = "+document.domain+" \n";

text += "7. lastModified = "+document.lastModified+" \n";

text += "8. defaultView = "+document.defaultView+" \n";

text += "9. 문서의 로드 완료 후 readyState= "+document.readyState+" \n";

text += "10. referrer = "+document.referrer+" \n";

text += "11. activeElement = "+document.activeElement.value+" \n";

text += "12. documentElement의 태그이름 = "+document.documentElement.tagName+" \n";


alert(text);

}

</script>

추천0 비추천 0

댓글목록 0

등록된 댓글이 없습니다.


Copyright © dancePKT. All rights reserved.
PC 버전으로 보기