인터넷 활용 정리
- 최초 등록일
- 2019.08.05
- 최종 저작일
- 2016.10
- 17페이지/ 한컴오피스
- 가격 1,500원
목차
1. 함수
2. 프로토타입
3. 시간
4. 도서반납시스템
5. 현재시각
6. form 태그
7. 리스트
8. 버튼 클릭시 이미지 태그
9. 버튼 클릭시 글자 바꾸기
10. 요소 숨기기
11. 동적으로 텍스트 추가
12. remove (제거)
본문내용
함수
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
</head>
<body>
<script>
function Student(name, school, dept){
this.name = name; this.school = school; this.dept = dept;
this.study = function() {
if (this.dept == "컴퓨터 공학")
document.write("Java Study" + "<br/>");
else if (this.dept == "디지털 컨텐츠 공학")
document.write("Game Study" + "<br/>");
}
this.play = function() {document.write("영화보기" + "<br/>");}
}
Student1 = new Student("최준석", "중앙대학교", "컴퓨터 공학");
document.write("이름 : " + Student1.name + "학교 : " + Student1.school + "학과 : " + Student1.dept + "<br/>");
Student1.study(); Student1.play();
Student2 = new Student("이승훈", "중앙대학교", "디지털 컨텐츠 공학");
document.write("이름 : " + Student2.name + "학교 : " + Student2.school + "학과 : " + Student2.dept + "<br/>");
Student2.study(); Student2.play();
</script>
</body>
</html>
참고 자료
없음