ํ‹ฐ์Šคํ† ๋ฆฌ ๋ทฐ

<%@ 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>๊ฐ์ฒด์—ฐ์Šต</title>
<script type="text/javascript">
 //๋นˆ ๊ฐ์ฒด๋กœ ๋งŒ๋“ค๊ธฐ
 var obj1 = new Object();

 //์—ฌ๊ธฐ์— ํ”„๋กœํผํ‹ฐ๋ฅผ ์„ค์ •ํ•  ์ˆ˜ ์žˆ๋‹ค.
 
 obj1.name  = "ํ™๊ธธ๋™";
 obj1.age = 20;
 obj1.address = "์„œ์šธ์‹œ ๊ฐ•๋‚จ๊ตฌ ์—ญ์‚ผ๋™";

 //๋™์ ์œผ๋กœ ๋ฉ”์†Œ๋“œ ์ง€์ •
 obj1.info = function () {
  alert(this.name + ", "
     + this.age + "์‚ด, "
     + this.address + "๊ฑฐ์ฃผ"
     );
 }

 obj1.info();
</script>
</head>
<body>

</body>
</html>

๋Œ“๊ธ€