Repository navigation
Expand file tree
/
Copy path4-01.HTML Element.html
More file actions
85 lines (67 loc) · 2.31 KB
/
Copy path4-01.HTML Element.html
File metadata and controls
85 lines (67 loc) · 2.31 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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
</head>
<body>
Text:
<br>
<input type="text" id="text1" value="ABC">
<br> 관심사:
<br>
<label>
<input type="checkbox" name="chk_interest" value="it"> IT/컴퓨터</label>
<label>
<input type="checkbox" name="chk_interest" value="entertainment"> 엔터테인먼트</label>
<label>
<input type="checkbox" name="chk_interest" value="sports"> 스포츠</label>
<label>
<input type="checkbox" name="chk_interest" value="shoping"> 쇼핑</label>
<label>
<input type="checkbox" name="chk_interest" value="book"> 도서/책</label>
<br> Radio:
<br>
<label>
<input type="radio" name="radio_email_yn" value="Y" checked> 동의</label>
<label>
<input type="radio" name="radio_email_yn" value="N"> 거부</label>
<br> Select:
<br>
<select id="select1">
<option value="KO">Korea</option>
<option value="CN">China</option>
<option value="JP">Japan</option>
</select>
<div id="div1"><h1>aofoeoefofoeffe</h1></div>
<br>
<button type="button" onclick="doSave();">Save</button>
<script>
document.getElementById("text1").value = "49423943";
function doSave() {
// console.log("doSave");
var oText1 = document.getElementById("text1");
console.log(oText1.value);
var textValue = oText1.value;
// console.log(oText1);
// var oText2 = document.querySelector("#text1");
// console.log(oText2);
// var oCheckbox = document.getElementsByName("chk_interest");
// console.log(oCheckbox);
// for(var i=0 ; i<oCheckbox.length ; i++) {
// if(oCheckbox[i].checked){
// console.log(oCheckbox[i].value);
// }
// }
var oCheckbox2 = document.querySelectorAll("[name=chk_interest]:checked");
console.log(oCheckbox2);
var oRadio = document.querySelector("[name=radio_email_yn]:checked");
console.log(oRadio);
var oSelect = document.getElementById("select1");
console.log(oSelect.value);
// console.log(document.getElementById("div1").innerHTML);
console.log(document.getElementsByTagName("div"));
}
</script>
</body>
</html>