Traversing - 지정된 표현식을 제외한 집합 가져오기
.NET프로그래밍/jQuery 1.3.2 2009. 11. 10. 12:07 |
[Not.htm]
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>지정된 표현식을 제외한 집합 가져오기</title>
<style type="text/css">
.Yellow { background-color:Yellow; }
</style>
<script src="../js/jquery-1.3.2-vsdoc2.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function () {
// 라디오버튼을 제외한 input 태그에 배경색을 Yellow로 설정
$('input').not("input[type=radio]").each(function () {
$(this).addClass("Yellow").css("border", "1px solid red");
});
});
</script>
</head>
<body>
<div id="myForm">
<input type="text" />
<input type="password" />
<input type="radio" />
</div>
</body>
</html>
-------------------------------------------------------------------------------------
[실행결과]
--> 아래그림에서 "라디오버튼을 제외한 input 태그"에 '배경색이 Yellow로, 테두리는 red'로 설정되었다.
'.NET프로그래밍 > jQuery 1.3.2' 카테고리의 다른 글
Manipulation - Append() 메서드 (DOM 요소 생성 후 원하는 요소에 추가) (0) | 2009.11.11 |
---|---|
Traversing - 방금 실행한 집합 이전으로 되돌리기 (0) | 2009.11.10 |
Traversing - 지정된 표현식이 있는지 없는지 검사 (0) | 2009.11.10 |
Traversing - n번째 요소 가져오기 (0) | 2009.11.10 |
Attributes - 폼 요소의 값 가져오기 및 설정 (0) | 2009.11.10 |