Traversing - 지정된 표현식을 제외한 집합 가져오기
[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'로 설정되었다.