-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path4-01(HTML Element).html
More file actions
99 lines (80 loc) · 3.08 KB
/
4-01(HTML Element).html
File metadata and controls
99 lines (80 loc) · 3.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
<html>
<head>
<title>HTML Element</title>
<head>
<body>
Text :
<!-- Element -->
<br />
<input type="text" value="홍길동" id="text1" />
<br />
관심사:
<br />
<input type="checkbox" name="chk_interest" value="it" />IT/컴퓨터
<input
type="checkbox"
name="chk_interest"
value="endtertainment"
/>엔터테인먼트
<input type="checkbox" name="chk_interest" value="sports" />스포츠
<input type="checkbox" name="chk_interest" value="shopping" />쇼핑
<input type="checkbox" name="chk_interest" value="book" />도서/책
<br />
<input type="radio" name="radio_email_yn" value="Y" checked />동의
<input type="radio" name="radio_email_yn" value="N" />거부
<br />
Select :
<select id="select1">
<option value="KO">Korea</option>
<option value="CH">China</option>
<option value="JP">Japan</option>
</select>
<br />
<div id="div1">
[div]태그를 사용합니다.
</div>
<input type="button" value="저장" onclick="doSave();" />
<script>
document.getElementById("text1").value = "이순신";
function doSave() {
// alert("추억이 떠오르니?");
// console.log("[저장] 버튼 클릭");
// var txt1 = document.getElementById("text1");
// console.log(txt1);
// console.log(txt1.value);
//jQuery 방식
// var txt2 = document.querySelector("#text1");
// console.log(txt2);
// console.log(txt2.value);
// var txt1 = document.getElementById("text1");
// console.log(txt1.value);
// var check_box1 = document.getElementsByName('chk_interest');
// console.log(check_box1);
// var check_box1 = document.getElementsByName("chk_interest");
// // console.log(check_box1);
// for(var i=0;i<check_box1.length;i++){
// if(check_box1[i].checked){
// console.log(check_box1[i].value);
// }
// }
//jQuery 방식
// var check_box2 = document.querySelectorAll('[name=chk_interest]:checked');
// console.log(check_box2);
//jQuery 방식
// var radio = document.querySelector('[name=radio_email_yn]:checked')
// console.log(radio.value);
// var select = document.getElementById("select1");
// console.log(select.value);
// var div_txt= document.getElementById("div1");
// console.log(div_txt);
// var div_txt= document.getElementById("div1").innerText;
// console.log(div_txt);
// var div_txt= document.getElementById("div1").innerHTML;
// console.log(div_txt);
console.log(document.getElementsByTagName("div"));
} //doSave
</script>
</body>
</head>
</head>
</html>