HTML script 태그

1 개요[ | ]

HTML script tag
HTML script 태그

2 기본 사용 방법[ | ]

HTML5 방식 ★
<script>
document.write('Hello');
</script>
→ script 태그에 type 속성 생략 가능 (기본값 "text/javascript")[1]
→ 예제: http://zetawiki.com/ex/js/hello.php
XHTML 방식
<script type="text/javascript">
//<![CDATA[
document.write('Hello');
//]]>
</script>

3 외부 파일 임포트[ | ]

<script src="위치/파일명.js"></script>

4 같이 보기[ | ]

5 주석[ | ]

  1. HTML 4에서는 필수, HTML5에서는 선택적. 구글 HTML/CSS 스타일 가이드에서도 생략

6 참고[ | ]

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}