-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path03_queryselector.html
More file actions
34 lines (33 loc) · 1.04 KB
/
03_queryselector.html
File metadata and controls
34 lines (33 loc) · 1.04 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
<!DOCTYPE html>
<html>
<head>
<meta charset="euc-kr" />
<meta name="viewport"
content="width=device-width, initial-scale=1.0,
maximum-scale=1.0, minimum-scale=1.0,
user-scalable=no"/>
<title>HTML5</title>
<script type="text/javascript">
function fun1() {
var firstDiv = document.querySelector("#firstDiv");
firstDiv.innerHTML = "변경된 DIV 내용";
}
function fun2() {
var array = document.querySelectorAll("#secondDiv input:checked");
for(var i=0; i<array.length; i++) {
console.log(array[i].value);
}
}
</script>
</head>
<body>
<div id="firstDiv" style="background-color:#ffff00">DIV 내용</div>
<form id="secondDiv">
<input type="checkbox" name="framework" value="jquerymobile"/>jQuery Mobile <br/>
<input type="checkbox" name="framework" value="senchatouch1"/>Sencha Touch 1 <br/>
<input type="checkbox" name="framework" value="senchatouch2"/>Sencha Touch 2
</form>
<button onclick="fun1()">div 찾기</button>
<button onclick="fun2()">check 찾기</button>
</body>
</html>