테스트 사이트 - 개발 중인 베타 버전입니다

jQuery( ":image" )

· 8년 전 · 1956

jQuery( ":image" )

:image ~에 해당합니다. [type="image"]

추가 참고 사항 :

:imagejQuery 확장이며 CSS 사양의 일부가 아니기 때문에 사용하는 쿼리 :image는 기본 DOM querySelectorAll()메서드 에서 제공하는 성능 향상을 이용할 수 없습니다 . 최신 브라우저의 성능을 높이려면 [type="image"]대신 사용하십시오.
예:
모든 이미지 입력을 찾습니다.

<!doctype html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <title>image demo</title>
  <style>
  textarea {
    height: 45px;
  }
  </style>
  <script src="https://code.jquery.com/jquery-1.10.2.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( event ) {
  event.preventDefault();
});
</script>
 
</body>
</html>

댓글 작성

댓글을 작성하시려면 로그인이 필요합니다.

로그인하기

게시글 목록

번호 제목
15895
15894
15893
15888
15887
15886
15885
jQuery .end()
15884
15883
jQuery .each()
15882
jQuery .die ()
15881
15880
15878
15877
15876
15874
15873
15872
15871
15866
15865
15864
15863
15862
15861
15859
15858
15857
15856
15855