7. 기본출력문
.NET프로그래밍/JavaScript 1.2 2009. 7. 30. 21:34 |<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
<title>기본출력문</title>
</head>
<body>
<script type="text/javascript">
//[1]
document.write("문서 영역에 결과 값 출력<br />");
window.document.write(
"<span style='color:red;'>window</span> 객체는 생략 가능</br />"); // 큰따옴표("") 안에는 작은따옴표('')로 묶어야 함.
//[2]
window.alert(" \"메시지박스\" 결과 값 출력"); // 큰따옴표("")를 메시지박스 안에 표시하고자 할때는 "앞에 \표기하면 됨.
alert("역시 window 객체(개체)는 생략 가능");
</script>
</body>
</html>
< 실행결과 >
--> 첫번째 메시지박스 '확인'버튼 누른 후
'.NET프로그래밍 > JavaScript 1.2' 카테고리의 다른 글
9. 산술연산자 (0) | 2009.07.30 |
---|---|
8. 변수선언초기화 참조 (0) | 2009.07.30 |
6. 객체 속성 메서드(함수) 이벤트 사용 (0) | 2009.07.30 |
5. 자바스크립트 작성 시 주의할 점 (0) | 2009.07.30 |
4. 태그 내에 자바스크립트 정의 (0) | 2009.07.30 |