π»
JavaScript μ μ΄ν΄ - [jQuery] Selector(1) : κΈ°λ³Έ, μμ(μμ/νμ ) λ³Έλ¬Έ
KITRI/JAVASCRIPT
JavaScript μ μ΄ν΄ - [jQuery] Selector(1) : κΈ°λ³Έ, μμ(μμ/νμ )
λν¨λ 2020. 7. 20. 16:26λ€μ΄λ‘λ λ° μ€μΉ
download jQuery
01_Object.html
04_IdSelector.html
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
<script type="text/javascript" src="../jquery.js"></script>
<script type="text/javascript">
// 1.
/* var obj = new jQuery(document); //μ νμ λλ μλ°μ€ν¬λ¦½νΈ κ°μ²΄
obj.ready(testFun);
function testFun(){
alert("jQuery μμμ
λλ€.");
} */
// 2.
/* new jQuery(document).ready(function (){ // new Date().getDay() μ²λΌ μ°λ κ²κ³Ό λκ°μ κ°λ
alert("jQuery μμμ
λλ€.");
}); */
// 3.
/* $(document).ready(function(){
alert("jQuery μμμ
λλ€.");
}); */
//4.
$(function(){
alert("jQuery μμμ
λλ€.");
});
</script>
</head>
<body>
</body>
</html>
05_ClassSelector.html
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
<script type="text/javascript" src="../jquery.js"></script>
<script type="text/javascript">
// 1.
/* var obj = new jQuery(document); //μ νμ λλ μλ°μ€ν¬λ¦½νΈ κ°μ²΄
obj.ready(testFun);
function testFun(){
alert("jQuery μμμ
λλ€.");
} */
// 2.
/* new jQuery(document).ready(function (){ // new Date().getDay() μ²λΌ μ°λ κ²κ³Ό λκ°μ κ°λ
alert("jQuery μμμ
λλ€.");
}); */
// 3.
/* $(document).ready(function(){
alert("jQuery μμμ
λλ€.");
}); */
//4.
$(function(){
alert("jQuery μμμ
λλ€.");
});
</script>
</head>
<body>
</body>
</html>
06_Hierarchy.html
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
<script type="text/javascript" src="../jquery.js"></script>
<script type="text/javascript">
// 1.
/* var obj = new jQuery(document); //μ νμ λλ μλ°μ€ν¬λ¦½νΈ κ°μ²΄
obj.ready(testFun);
function testFun(){
alert("jQuery μμμ
λλ€.");
} */
// 2.
/* new jQuery(document).ready(function (){ // new Date().getDay() μ²λΌ μ°λ κ²κ³Ό λκ°μ κ°λ
alert("jQuery μμμ
λλ€.");
}); */
// 3.
/* $(document).ready(function(){
alert("jQuery μμμ
λλ€.");
}); */
//4.
$(function(){
alert("jQuery μμμ
λλ€.");
});
</script>
</head>
<body>
</body>
</html>
08_Hierarchy.html
<!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=UTF-8">
<title>jQuery - κ³μΈ΅ μ νμ</title>
<style type="text/css">
div{
background-color:#EEEEEE;
padding:10px;
width:500px;
}
</style>
<script type="text/javascript" src="../jquery.js"></script>
<script type="text/javascript">
$(document).ready(function(){
// label μ νμμ λ°λ‘ λ€μμ inputνκ·Έ
$("label + input").css("border", "1px solid #F00");
});
</script>
<body>
<form action="#" method="post">
<label>μ΄λ¦</label>
<input type="text" name="name"/>
<input type="text" name="addr"/>
<br/><br/>
<b>λ°λμ μ
λ ₯νμΈμ.</b>
<br/><br/>
<fieldset> <!-- 컨νΈλ‘€μ κ·Έλ£Ήννλ λ²μ -->
<legend>νμμ
λ ₯μ¬ν</legend> <!-- κ·Έλ£Ήννλ λ²μμ μ΄λ¦ -->
<label>μμ΄λ</label>
<input type="text" name="id"/>
<label>λΉλ°λ²νΈ</label>
<input type="password" name="password"/>
<input type="password" name="password"/>
</fieldset>
<br/>
<label>
E-MAIL
<input type="text" name="email"/>
</label>
</form>
</body>
</html>
09_Hierarchy.html
<!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=UTF-8">
<title>jQuery - κ³μΈ΅ μ νμ</title>
<style>
div,p{
width:100px;
height:80px;
float:left;
padding:10px;
margin:10px;
box-shadow:3px 3px 5px;
background:#EEEEEE;
}
#second{
width:60px;
height:20px;
font-size:12px;
background:#ddaa99;
}
</style>
<script type="text/javascript" src="../jquery.js"></script>
<script type="text/javascript">
$(document).ready(function(){
//μμ΄λκ° firstμΈ κ²μ λͺ¨λ λμμ€μ divνκ·Έ λ½μμ€κΈ°
$("#first ~ div").css("border", "5px dotted #EA9");
});
</script>
</head>
<body>
<h2>맀물μλ΄</h2>
<h4>κ±°λμλ£λ 맀물μ 보λ μλ£ λͺ©λ‘μ μ°Έκ³ νμΈμ.</h4>
<div>
κΈλ§€ <br/>
λΉλΌ 33νν λ°©3, μμ€2
</div>
<div id="first">
맀맀 <br/>
κ·Έλ¦° APT 20νν, μ λ§ μ’μ
</div>
<div>
μλ <br/>
λ³΄λΌ μ€νΌμ€ν
18ν
</div>
<div>
μλ <br/>
<div id="second">κ·Έλ¦° APT 40νν</div>
</div>
<p>νΉλ³λΆμ μμ΅ν μ€νΌμ€ν
</p>
</body>
</html>
λ°μν
'KITRI > JAVASCRIPT' μΉ΄ν κ³ λ¦¬μ λ€λ₯Έ κΈ
JavaScript μ μ΄ν΄ - [jQuery] DOM ν¨μ(1) (0) | 2020.07.21 |
---|---|
JavaScript μ μ΄ν΄ - [jQuery] Selector(2) : νν° (0) | 2020.07.21 |
JavaScript μ μ΄ν΄ - [AJAX] Kakao μ§λ Javscript API μ΄μ©ν΄μ μ§λ그리기 (0) | 2020.07.20 |
JavaScript μ μ΄ν΄ - [AJAX] κΈ°μμ² λ°μ΄ν° Parsing (0) | 2020.07.20 |
JavaScript μ μ΄ν΄ - [AJAX] XMLHttpRequest.responseXML (0) | 2020.07.16 |
Comments