● 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>
- 이전글● window.open() 21.07.18
- 다음글● this 속성 21.07.18
댓글목록
등록된 댓글이 없습니다.