: 기능을 정의해 놓은 것
형식)
function 함수이름(매개변수1, 매개변수2) {
함수 호출 시 실행될 문장;
}
=============================코드=============================
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
<script type="text/javascript">
function hello() {
alert("안녕하세요? 무사히 출석 하셨군요!")
}
</script>
</head>
<body>
/* onclick는 클릭했을 때 동작할 것 */
<input type="button" onclick = "hello()" value = "버튼클릭">
</body>
</html>

