양사 2018. 5. 5. 09:52
자바스크립트
document 객체

document 객체는 말 그대로 문서화면 전체입니다. 웹 브라우저의 '보이는 부분'이 document 객체 부분입니다.
document 객체의 대표적인 메소드는 다음과 같습니다.
write: 직접적으로 글자 출력
getElementById: 아이디 구하기
textContent: 텍스트 수정
document 객체는 문서의 출력을 다루기 때문에 상당히 많이 사용합니다.

예시
(생략)
document.write("hello"); //화면에 hello라고 출력
(생략)

출력
hello