jquery 선택 기: password

1776 단어 htmljquerycss
:password
input 에서 type 속성 이 password 인 input 요소 집합 과 일치 합 니 다.일치 하 는 요소 집합 되 돌리 기
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" 
                    "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
  <script src="http://code.jquery.com/jquery-latest.js"></script>
  
  <script>
  $(document).ready(function(){
    
    var input = $(":password").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>
  <style>
  textarea { height:45px; }
  </style>
</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>
</body>
</html>

 
var input = $(":password").css({background:"yellow", border:"3px red solid"});input 에서 type 속성 이 password 인 input 요소 집합 과 일치 합 니 다.다음은 일치 집합

좋은 웹페이지 즐겨찾기