:image 는 폼 요소 중에서 type="image" 인 요소를 찾습니다.
원문 링크
http://api.jquery.com/image-selector/
- jQuery(':image')
예 제
input 중 type 이 image 인 요소를 찾아 빨간 테두리를 두룹니다.
<!DOCTYPE html>
<html>
<head>
<style>
textarea { height:45px; }
</style>
<script src="http://code.jquery.com/jquery-1.5.js"></script>
</head>
<body>
<form>
<input type="button" value="Input Button"/>
<input type="checkbox" />
<input type="file" />
<input type="hidden" />
<input type="image" />
<input type="password" />
<input type="radio" />
<input type="reset" />
<input type="submit" />
<input type="text" />
<select><option>Option<option/></select>
<textarea></textarea>
<button>Button</button>
</form>
<div>
</div>
<script>
var input = $("input:image").css({background:"yellow", border:"3px red solid"});
$("div").text("For this type jQuery found " + input.length + ".")
.css("color", "red");
$("form").submit(function () { return false; }); // so it won't submit
</script>
</body>
</html>
미리보기
이건 뭐 누워서 떡먹기?? 체합니다. 떡은 앉아서 드세요. :-)
그럼 즐프하세요.
※ 본 예제는 http://www.jquery.com 에 있는 내용임을 밝힙니다.
'프로그래밍 > jQuery' 카테고리의 다른 글
| jQuery API 정복 - 다중 속성 필터를 이용한 요소 선택 : Mutiple Attribute Selector (2) | 2011.02.12 |
|---|---|
| jQuery API 정복 - 마지막 자식 요소 찾기 : last (2) | 2011.02.12 |
| jQuery API 정복 - 마지막 자식 요소들 찾기 : last-child (2) | 2011.02.11 |
| jQuery API 정복 - 폼에 속한 input 들 선택하기 : jQuery(':input') (0) | 2011.02.11 |
| jQuery API 정복 - ID 로 찾아내기 : jQuery("#id") (7) | 2011.02.10 |
| jQuery API 정복 - 안보이는 요소 찾기 : jQuery(':hidden') (1) | 2011.02.10 |
| jQuery API 정복 - 제목 태그(h1)를 찾자 : jQuery(':header') (8) | 2011.02.09 |
| jQuery API 정복 - 자식 중에 태그 찾기 : jQuery(':has(selector)') (30) | 2011.02.09 |