jQuery | javascript | CSS
35.jQuery - Not ( 04.Traversing - 03.Not)
Godffs
2009. 11. 11. 11:22
반응형
not : 지정된 선택기와 맞는 요소를 제외한 나머지 검색
| 03.Not.htm |
|
<html xmlns="http://www.w3.org/1999/xhtml"> <head>
<title>지정된 표현식을 제외한 집합 가져오기</title>
<style type="text/css">
.Yellow{ background-color:Yellow;
}
</style>
<script src="../jQuery/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> |
| 결과화면 |
[그림35-1] |
반응형
03.Not.htm