HTML에서 JavaScript 로드하기
HTML에서 JavaScript를 로드하는 다양한 방법에 대해서 학습
inline 방식
<!DOCTYPE html>
<html lang="ko">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title></title>
</head>
<body>
<!-- onclick 속성에 자바스크립트 기 -->
<input type="button" value="Hello world" onclick="alert('Hello world')" />
</body>
</html>script 태그를 이용한 방식
외부 파일로 분리
script 태그의 위치
Last updated