์๋ฐ์คํฌ๋ฆฝํธ class ๊ฐ๋
<%@ page language="java" contentType="text/html; charset=EUC-KR"
pageEncoding="EUC-KR"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=EUC-KR">
<title>Template ์ ์ด์ฉํ ๊ฐ์ฒด์์ฑ</title>
<script type="text/javascript">
//๊ฐ์ฒด ์์ฑ์ฉ ํ
ํ๋ฆฟ
function Person(ssn, name, address) {
this.ssn = ssn;
this.name = name;
this.address = address;
this.info = function() {
alert(this.name + ", "
+ this.ssn + ", "
+ this.address + "๊ฑฐ์ฃผ"
);
}
}
//๊ฐ์ฒด์์ฑ
var p1 = new Person(1, "ํ๊ธธ๋", "๊ฐ๋จ๊ตฌ ์ญ์ผ๋");
var p2 = new Person(2, "์๊ฑฑ์ ", "์กํ๊ตฌ ์ญ์ผ๋");
p1.info();
p2.info();
</script>
</head>
<body>
</body>
</html>