<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<script type="text/javascript" src="js/jquery-1.7.1.min.js"></script>
<script type="text/javascript" src="js/jquery-ui-1.8.17.custom.min.js"></script>
<script type="text/javascript">
$(function(){
$("input").val("1111"); //모든 input테그에 value값을 ddddd로 넣어준다.
$("input").css("border","3px solid red"); //모든 input테그에 css값을 적용한다.
$("input").attr("disabled",true); //모든 input테그를 disabled상태로 만든다.
$("input[id ='man']").val("4444"); // input테그 중 아이디가 man인것만 해당 값을 넣어준다.
$("input[id ='man']").css("border","3px solid red"); // input테그 중 아이디가 man인것만 골라서 css를 적용한다.
$("input[id ='man']").attr("disabled",true); // input테그 중 아이디가 man인것만 골라서 disabled상태로 만든다.
$("input[id^='man']").val("2222"); // input테그 중 아이디가 man으로 시작되는 것 만 골라서 해당 값을 넣어준다.
$("input[id^='man']").css("border","3px solid red"); // input테그 중 아이디가 man으로 시작되는 것 만 골라서 css를 적용한다.
$("input[id^='man']").attr("disabled",true); // input테그 중 아이디가 man으로 시작되는 것 만 골라서 disabled상태로 만든다.
$("input[id$='man']").val("3333"); // input테그 중 아이디가 man으로 끝나는 것 만 골라서 해당 값을 넣어준다.
$("input[id$='man']").css("border","3px solid red"); // input테그 중 아이디가 man으로 끝나는 것 만 골라서 css를 적용한다.
$("input[id$='man']").attr("disabled",true); // input테그 중 아이디가 man으로 끝나는 것 만 골라서 disabled상태로 만든다.
$("input[id!='man']").val("4444"); // input테그 중 아이디가 man이 아닌것만 해당 값을 넣어준다.
$("input[id!='man']").css("border","3px solid red"); // input테그 중 아이디가 man이 아닌것만 골라서 css를 적용한다.
$("input[id!='man']").attr("disabled",true); // input테그 중 아이디가 man이 아닌것만 골라서 disabled상태로 만든다.
});
</script>
<title>Insert title here</title>
</head>
<body>
<input id="manffffff" />
<input id="letterman" />
<input id="newmilk" />
<br>
* jquery에서 id를 name으로 바꾸면 input테그의 name으로 동일한 효과를 볼 수 있다.
</body>