ȸ¿ø°¡ÀԡžÆÀ̵ð/ºñ¹øã±â
ȨÀ¸·Î

JQuery ±âº» ¿¹Á¦ ¸ðÀ½
12³â Àü
<jQuery Core>

1. jQuery( html )  Returns: jQuery
jQuery( html ), ½ÇÇàÈÄ jQuery°´Ã¼¸¦ ¹Ýȯ

Create DOM elements on-the-fly from the provided String of raw HTML.
ÁÖ¾îÁø htmlÀ» °¡Áö°í ºü¸£°Ô ¹®¼­ ¿ø¼Ò¸¦ »ý¼ºÇÑ´Ù.
±×¸®°í jQuery°´Ã¼·Î¼­ ±× °ÍÀ» ¹ÝȯÇÑ´Ù.
À̸»Àº ±×°ÍÀ» À̾ jQueryÀÇ ´Ù¸¥ ÇÔ¼ö¿Í ÇÔ²² »ç¿ë°¡´ÉÇÏ´Ù´Â ¶æÀÌ´Ù.

<!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(){
   $("<div><p>Hello</p></div>").appendTo("body");
  });
  </script>

</head>
<body>
</body>
</html>



2. jQuery( elements )  Returns: jQuery
jQuery( ¿ø¼Ò ) jQuery( ¿ø¼Ò.¿ø¼Ò.¿ø¼Ò ), ½ÇÇàÈÄ jQuery°´Ã¼¸¦ ¹Ýȯ

Wrap jQuery functionality around a single or multiple DOM Element(s).
Çϳª ¶Ç´Â ´Ù´Ü°èÀÇ ¹®¼­¿ø¼Ò·Î¼­ »ç¿ëÇÒ¼ö ÀÖ´Ù.

<!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(){
   $(document.body).css( "background", "black" );
  });
  </script>

</head>
<body>
</body>
</html>



3. jQuery( callback )  Returns: jQuery
jQuery( ÄݹéÇÔ¼ö ), ½ÇÇàÈÄ jQuery°´Ã¼¸¦ ¹Ýȯ

A shorthand for $(document).ready().
$()Àº $(document).ready() ÀÇ ÂªÀº Ç¥ÇöÀ¸·Î »ç¿ë°¡´ÉÇÏ´Ù.
$(document).ready() Àº ¹®¼­°¡ »ç¿ë°¡´ÉÇÑ ½ÃÁ¡À» ÀÚµ¿À¸·Î ÀνÄÇÏ¿© ÁÖ¾îÁø Äݹé ÇÔ¼ö¸¦ µ¿ÀÛ½ÃŲ´Ù.
ÄݹéÇÔ¼ö¶õ ÁöÁ¤µÈ ÇàÀ§°¡ ³¡³­´ÙÀ½ ÀÚµ¿ÀûÀ¸·Î ½ÇÇàµÉ ÇÔ¼ö¸¦ ÀǹÌÇÑ´Ù.

<!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>
  $(function(){

   $(document.body).css( "background", "black" );
  });
  </script>

</head>
<body>
</body>
</html>



4. each( callback )  Returns: jQuery
each( ÄݹéÇÔ¼ö ),  ½ÇÇàÈÄ jQuery°´Ã¼¸¦ ¹Ýȯ

Execute a function within the context of every matched element.
¸ÅÄ¡ µÇ¾îÁø ¸ðµç ¿ø¼Ò¿¡ ´ëÇØ ÁÖ¾îÁø Äݹé ÇÔ¼ö¸¦ ½ÇÇàÇÑ´Ù. ·çÇÁÀÇ ÀǹÌÀÌ´Ù.

<!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(){

   $(document.body).click(function () {
     $("div").each(function (i) {
       if (this.style.color != "blue") {
         this.style.color = "blue";
       } else {
         this.style.color = "";
       }
     });
   });

  });
  </script>
  <style>
  div { color:red; text-align:center; cursor:pointer;
       font-weight:bolder; width:300px; }
  </style>
</head>
<body>
  <div>Click here</div>
  <div>to iterate through</div>
  <div>these divs.</div>
</body>
</html>



5. size( )  Returns: Number
size( ), ½ÇÇàÈÄ ¼ýÀÚ¸¦ ¹Ýȯ

The number of elements in the jQuery object.
¸ÅÄ¡µÇ¾îÁø ¿ø¼ÒµéÀÇ °¹¼ö¸¦ ¹ÝȯÇÑ´Ù.

<!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(){

   $(document.body).click(function () {
     $(document.body).append($("<div>"));
     var n = $("div").size();
     $("span").text("There are " + n + " divs." +
                    "Click to add more.");
   }).click(); // trigger the click to start

  });
  </script>
  <style>
  body { cursor:pointer; }
  div { width:50px; height:30px; margin:5px; float:left;
       background:blue; }
  span { color:red; }
  </style>
</head>
<body>
  <span></span>
  <div></div>
</body>
</html>



6. length  Returns: Number
length, ½ÇÇàÈÄ ¼ýÀÚ¸¦ ¹Ýȯ

The number of elements in the jQuery object.
¸ÅÄ¡µÇ¾îÁø ¿ø¼ÒµéÀÇ °¹¼ö¸¦ ¹ÝȯÇÑ´Ù.

<!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(){

   $(document.body).click(function () {
     $(document.body).append($("<div>"));
     var n = $("div").length;
     $("span").text("There are " + n + " divs." +
                    "Click to add more.");
   }).trigger('click'); // trigger the click to start

  });
  </script>
  <style>
  body { cursor:pointer; }
  div { width:50px; height:30px; margin:5px; float:left;
       background:green; }
  span { color:red; }
  </style>
</head>
<body>
  <span></span>
  <div></div>
</body>
</html>



7. get( )  Returns: Array<Element>
get( ), ½ÇÇàÈÄ ¿ø¼Ò ¹è¿­ ¹Ýȯ

Access all matched DOM elements.
¸ÅÄ¡µÇ´Â ¸ðµç ¹®¼­ ¿ø¼ÒµéÀ» ¹è¿­·Î ¹ÝȯÇÑ´Ù.

<!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(){

   function disp(divs) {
     var a = [];
     for (var i = 0; i < divs.length; i++) {
       a.push(divs[i].innerHTML);
     }
     $("span").text(a.join(" "));
   }

   disp( $("div").get().reverse() );

  });
  </script>
  <style>
  span { color:red; }
  </style>
</head>
<body>
  Reversed - <span></span>
  <div>One</div>
  <div>Two</div>
  <div>Three</div>
</body>
</html>



8. get( index )  Returns: Element
get( À妽º ), ½ÇÇàÈÄ ¸ÅÄ¡ µÇ´Â ¿ø¼Ò¸¦ ¹Ýȯ

Access a single matched DOM element at a specified index in the matched set.
¸ÅÄ¡µÇ´Â ¿ø¼Òµé Áß ÁÖ¾îÁø À妽º¿¡ ÇØ´çÇÏ´Â ÇϳªÀÇ ¿ø¼Ò¸¸ ¹ÝȯÇÑ´Ù.

<!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(){

   $("*", document.body).click(function (e) {
     e.stopPropagation();
     var domEl = $(this).get(0);
     $("span:first").text("Clicked on - " + domEl.tagName);
   });

  });
  </script>
  <style>
  span { color:red; }
  div { background:yellow; }
  </style>
</head>
<body>
  <span> </span>
  <p>In this paragraph is an <span>important</span> section</p>
  <div><input type="text" /></div>
</body>
</html>



9. index( subject )  Returns: Number
index( °´Ã¼ ), ½ÇÇàÈÄ ¼ýÀÚ¸¦ ¹Ýȯ

Searches every matched element for the object and returns the index of the element, if found, starting with zero.
¸ÅÄ¡µÇ¾îÁø ¿ø¼Òµé¿¡ ´ëÇØ ÁÖ¾îÁø °´Ã¼¿Í µ¿ÀÏÇÑ°ÍÀ» °Ë»öÇÏ¿©,
Á¸ÀçÇÏ¸é ±× ¿ø¼ÒµéÁß¿¡ ¸î¹ø°¿¡ ÇØ´çÇϴ°¡ ÇÏ´Â À妽º ¹øÈ£¸¦ ¹ÝȯÇÑ´Ù.
À妽º´Â 0ºÎÅÍ ½ÃÀÛÇÑ´Ù.

<!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(){

   $("div").click(function () {
     // this is the dom element clicked
     var index = $("div").index(this);
     $("span").text("That was div index #" + index);
   });

  });
  </script>
  <style>
  div { background:yellow; margin:5px; }
  span { color:red; }
  </style>
</head>
<body>
  <span>Click a div!</span>
  <div>First div</div>
  <div>Second div</div>
  <div>Third div</div>
</body>
</html>



10. jQuery.fn.extend( object )  Returns: jQuery
jQuery.fn.extend( °´Ã¼), ½ÇÇàÈÄ jQuery°´Ã¼¸¦ ¹Ýȯ

Extends the jQuery element set to provide new methods (used to make a typical jQuery plugin).
Á¦ÀÌÄõ¸®¿¡ »õ·Î¿î ÇÔ¼ö¸¦ È®ÀåÇÑ´Ù.(Ç÷¯±×ÀÎÀ¸·Î ¸¸µé¾î »ç¿ëÇÑ´Ù.)


<!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>
  jQuery.fn.extend({
   check: function() {
     return this.each(function() { this.checked = true; });
   },
   uncheck: function() {
     return this.each(function() { this.checked = false; });
   }
  });

  $(function(){

   $("#button1").click(function(){

     $('input').check();
   });

   $("#button2").click(function(){

     $('input').uncheck();
   });
  });
  </script>
  <style>
  div { background:yellow; margin:5px; }
  span { color:red; }
  </style>
</head>
<body>
<form>
<input type="checkbox" name="">
<input type="checkbox" name="">
<input type="checkbox" name="">
<input type="checkbox" name="">
<input type="checkbox" name="">
<input type="checkbox" name="">
</form>
<input type='button' id='button1' value='Àüü¼±ÅÃ'>
<input type='button' id='button2' value='ÀüüÇØÁ¦'>
</body>
</html>



11. jQuery.extend( object )  Returns: jQuery
jQuery.fn.extend( °´Ã¼), ½ÇÇàÈÄ jQuery°´Ã¼¸¦ ¹Ýȯ

Extends the jQuery object itself.
Á¦ÀÌÄõ¸® ÀÚü¸¦ È®Àå
¾ÆÁ÷Àº Àß ¸ð¸£°ÙÀ½



14. jQuery.noConflict( )  Returns: jQuery
jQuery.noConflict( ),  ½ÇÇàÈÄ jQuery°´Ã¼¸¦ ¹Ýȯ

Run this function to give control of the $ variable back to whichever library first implemented it.
¾ÆÁ÷Àº Àß ¸ð¸£°ÚÀ½


15. jQuery.noConflict( extreme )  Returns: jQuery
jQuery.noConflict( extreme ), ½ÇÇàÈÄ jQuery°´Ã¼¸¦ ¹Ýȯ

Revert control of both the $ and jQuery variables to their original owners. Use with discretion.
¾ÆÁ÷Àº Àß ¸ð¸£°ÚÀ½





<Selectors>=>°´Ã¼ ¼±Ã¥

1. #id  Returns: Element
#¾ÆÀ̵ð, ½ÇÇàÈÄ ¿ø¼Ò ¹Ýȯ

Matches a single element with the given id attribute.
ÁÖ¾îÁø ¾ÆÀ̵𿡠¸ÅÄ¡µÇ´Â ¿ø¼ÒÇϳª¸¦ ã¾Æ ¹Ýȯ

<!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(){
   $("#myDiv").css("border","3px solid red");
  });
  </script>
  <style>
  div {
   width: 90px;
   height: 90px;
   float:left;
   padding: 5px;
   margin: 5px;
   background-color: #EEEEEE;
  }
  </style>
</head>
<body>
  <div id="notMe"><p>id="notMe"</p></div>
  <div id="myDiv">id="myDiv"</div>
</body>
</html>



2. element  Returns: Array<Element>
¿ø¼Ò¸í, ½ÇÇàÈÄ ¿ø¼Ò ¹è¿­ ¹Ýȯ

Matches all elements with the given name.
ÁÖ¾îÁø ¿ø¼Ò¸í¿¡ ¸ÅÄ¡µÇ´Â ¸ðµç ¿ø¼Ò¸¦ ¹è¿­·Î ¹Ýȯ

<!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(){
   $("div").css("border","3px solid red");
  });
  </script>
  <style>
  div,span {
   width: 60px;
   height: 60px;
   float:left;
   padding: 10px;
   margin: 10px;
   background-color: #EEEEEE;
  }
  </style>
</head>
<body>
  <div>DIV1</div>
  <div>DIV2</div>
  <span>SPAN</span>
</body>
</html>



3. .class  Returns: Array<Element>
Ŭ·¡½º¸í, ½ÇÇàÈÄ ¿ø¼Ò¹è¿­·Î ¹Ýȯ

Matches all elements with the given class.
ÁÖ¾îÁø Ŭ·¡½º¸í¿¡ ¸ÅÄ¡µÇ´Â ¸ðµç ¿ø¼Ò¸¦ ¹è¿­·Î ¹Ýȯ

<!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(){
   $(".myClass").css("border","3px solid red");
  });
  </script>
  <style>
  div,span {
   width: 150px;
   height: 60px;
   float:left;
   padding: 10px;
   margin: 10px;
   background-color: #EEEEEE;
  }
  </style>
</head>
<body>
  <div class="notMe">div class="notMe"</div>
  <div class="myClass">div class="myClass"</div>
  <span class="myClass">span class="myClass"</span>
</body>
</html>



4. *  Returns: Array<Element>
¸ðµç°Í, ½ÇÇàÈÄ ¿ø¼Ò ¹è¿­·Î ¹Ýȯ

Matches all elements.
¸ÅÄ¡µÇ´Â ¸ðµç ¿ø¼Ò¸¦ ¹ÝȯÇÑ´Ù.

<!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(){
   $("*").css("border","3px solid red");
  });
  </script>
  <style>
  div,span,p {
   width: 150px;
   height: 60px;
   float:left;
   padding: 10px;
   margin: 10px;
   background-color: #EEEEEE;
  }
  </style>
</head>
<body>
  <div>DIV</div>
  <span>SPAN</span>
  <p>P <button>Button</button></p>
</body>
</html>



5. selector1, selector2, selectorN  Returns: Array<Element>
selector1, selector2, selectorN, ½ÇÇàÈÄ ¿ø¼Ò¹è¿­·Î ¹Ýȯ

Matches the combined results of all the specified selectors.
ÁÖ¾îÁø °Íµé¿¡ ´ëÇØ ¸ÅÄ¡µÇ´Â ¸ðµç ¿ø¼Ò¸¦ ¹è¿­·Î ¹Ýȯ
±¸ºÐÀÚ´Â ,

<!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(){
   $("div,span,p.myClass").css("border","3px solid red");
  });
  </script>
  <style>
  div,span,p {
   width: 130px;
   height: 60px;
   float:left;
   padding: 3px;
   margin: 2px;
   background-color: #EEEEEE;
   font-size:14px;
  }
  </style>
</head>
<body>
  <div>div</div>
  <p class="myClass">p class="myClass"</p>
  <p class="notMyClass">p class="notMyClass"</p>
  <span>span</span>
</body>
</html>



6. ancestor descendant  Returns: Array<Element>
Á¶»ó ÀÚ¼Õ, ½ÇÇàÈÄ ¿ø¼Ò ¹è¿­·Î ¹Ýȯ

Matches all descendant elements specified by "descendant" of elements specified by "ancestor".
ÁÖ¾îÁø Á¶»ó¿¡ ÁÖ¾îÁø ÀÚ¼ÕÀ» °¡Áø ¸ðµç ÀÚ¼ÕÀ» ¹è¿­·Î ¹Ýȯ

<!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(){
   $("form input").css("border", "2px dotted blue");
  });
  </script>
  <style>
  body { font-size:14px; }
  form { border:2px green solid; padding:2px; margin:0;
        background:#efe; }
  div { color:red; }
  fieldset { margin:1px; padding:3px; }
  </style>
</head>
<body>
  <form>
   <div>Form is surrounded by the green outline</div>
   <label>Child:</label>
   <input name="name" />
   <fieldset>
     <label>Grandchild:</label>
     <input name="newsletter" />
   </fieldset>
  </form>
  Sibling to form: <input name="none" />
</body>
</html>



7. parent > child  Returns: Array<Element>
Á¶»ó > ÀÚ¼Õ, ½ÇÇàÈÄ ¿ø¼Ò ¹è¿­ ¹Ýȯ

Matches all child elements specified by "child" of elements specified by "parent".
ÁÖ¾îÁø Á¶»ó¿¡ Æ÷ÇÔµÈ ÁÖ¾îÁø ÀÚ¼Õ¿¡ ¸ÅÄ¡µÇ´Â ÀÏ´Ü°è Àڼյ鸸 ¸ðµÎ ¹è¿­·Î ¹Ýȯ

<!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(){
   $("#main > *").css("border", "3px double red");
  });
  </script>
  <style>
  body { font-size:14px; }
  span#main { display:block; background:yellow; height:110px; }
  button { display:block; float:left; margin:2px;
          font-size:14px; }
  div { width:90px; height:90px; margin:5px; float:left;
       background:#bbf; font-weight:bold; }
  div.mini { width:30px; height:30px; background:green; }
  </style>
</head>
<body>
  <span id="main">
   <div></div>
   <button>Child</button>
   <div class="mini"></div>
   <div>
     <div class="mini"></div>
     <div class="mini"></div>
   </div>
   <div><button>Grand</button></div>
   <div><span>A Span <em>in</em> child</span></div>
   <span>A Span in main</span>
  </span>
</body>
</html>



8. prev + next  Returns: Array<Element>
¾Õ µÚ, ½ÇÇàÈÄ ¿ø¼Ò¹è¿­ ¹Ýȯ

Matches all next elements specified by "next" that are next to elements specified by "prev".
ÁÖ¾îÁø ¾Õ¿ø¼Ò¿Í µÚ¿ø¼Ò¿¡ ¼øÂ÷ÀûÀ¸·Î ¸ÅÄ¡ µÇ´Â µÚ¿ø¼ÒµéÀ» ¸ðµÎ ¹è¿­·Î ¹Ýȯ

<!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(){
   $("label + input").css("color", "blue").val("Labeled!")
  });
  </script>

</head>
<body>
  <form>
   <label>Name:</label>
   <input name="name" />
   <fieldset>
     <label>Newsletter:</label>
     <input name="newsletter" />
   </fieldset>
  </form>
  <input name="none" />
</body>
</html>



9. prev ~ siblings  Returns: Array<Element>
¾Õ¿ø¼Ò~ÇüÁ¦ ¿ø¼Ò, ½ÇÇàÈÄ ¿ø¼Ò¹è¿­ ¹Ýȯ

Matches all sibling elements after the "prev" element that match the filtering "siblings" selector.
ÁÖ¾îÁø ¾Õ¿ø¼Ò¿Í ÇüÁ¦ÀÎ µÚ¿ø¼Ò¸¦ ã¾Æ ¸ðµÎ ¹è¿­·Î ¹Ýȯ

<!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(){
   $("#prev ~ div").css("border", "3px groove blue");
  });
  </script>
  <style>
  div,span {
   display:block;
   width:80px;
   height:80px;
   margin:5px;
   background:#bbffaa;
   float:left;
   font-size:14px;
  }
  div#small {
   width:60px;
   height:25px;
   font-size:12px;
   background:#fab;
  }
  </style>
</head>
<body>
  <div>div (doesn't match since before #prev)</div>
  <div id="prev">div#prev</div>
  <div>div sibling</div>
  <div>div sibling <div id="small">div neice</div></div>
  <span>span sibling (not div)</span>
  <div>div sibling</div>
</body>
</html>



10. :first  Returns: Element
ù¹ø°, ½ÇÇàÈÄ ¿ø¼Ò ¹Ýȯ

Matches the first selected element.
¸ÅÄ¡µÇ´Â ¿ø¼ÒµéÁß Ã¹¹ø° °Í¸¸ ¹ÝȯÇÑ´Ù.

<!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(){
   $("tr:first").css("font-style", "italic");
  });
  </script>
  <style>
  td { color:blue; font-weight:bold; }
  </style>
</head>
<body>
  <table>
   <tr><td>Row 1</td></tr>
   <tr><td>Row 2</td></tr>
   <tr><td>Row 3</td></tr>
  </table>
</body>
</html>



11. :last  Returns: Element
¸¶Áö¸·, ½ÇÇàÈÄ ¿ø¼Ò ¹Ýȯ

Matches the last selected element.
¸ÅÄ¡µÇ´Â ¿ø¼ÒµéÁß ¸¶Áö¸· °Í¸¸ ¹ÝȯÇÑ´Ù.

<!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(){
   $("tr:last").css({backgroundColor: 'yellow', fontWeight: 'bolder'});
  });
  </script>

</head>
<body>
  <table>
   <tr><td>First Row</td></tr>
   <tr><td>Middle Row</td></tr>
   <tr><td>Last Row</td></tr>
  </table>
</body>
</html>



12. :not(selector)  Returns: Array<Element>
¾Æ´Ï´Ù, ½ÇÇàÈÄ ¿ø¼Ò ¹è¿­ ¹Ýȯ

Filters out all elements matching the given selector.
ÁÖ¾îÁø °Í¿¡ ÇØ´çÇÏÁö ¾Ê´Â ¸ðµç °ÍÀ» ¹ÝȯÇÑ´Ù.

<!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(){

   $("input:not(:checked) + span").css("background-color", "yellow");
   $("input").attr("disabled", "disabled");

  });
  </script>

</head>
<body>
  <div>
   <input type="checkbox" name="a" />
   <span>Mary</span>
  </div>
  <div>
   <input type="checkbox" name="b" />
   <span>Paul</span>
  </div>
  <div>
   <input type="checkbox" name="c" checked="checked" />
   <span>Peter</span>
  </div>
</body>
</html>



13. :even  Returns: Array<Element>
¦¼ö, ½ÇÇàÈÄ ¿ø¼Ò ¹è¿­ ¹Ýȯ

Matches even elements, zero-indexed.
¸ÅÄ¡µÈ ¿ø¼Òµé Áß¿¡¼­ À妽º°¡ ¦¼öÀÎ°Í ¸ðµÎ ¹ÝȯÇÑ´Ù.

<!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(){
   $("tr:even").css("background-color", "#bbbbff");
  });
  </script>
  <style>
  table {
   background:#eeeeee;
  }
  </style>
</head>
<body>
  <table border="1">
   <tr><td>Row with Index #0</td></tr>
   <tr><td>Row with Index #1</td></tr>
   <tr><td>Row with Index #2</td></tr>
   <tr><td>Row with Index #3</td></tr>
  </table>
</body>
</html>



14. :odd  Returns: Array<Element>
Ȧ¼ö, ½ÇÇàÈÄ ¿ø¼Ò ¹è¿­ ¹Ýȯ

Matches odd elements, zero-indexed.
¸ÅÄ¡µÈ ¿ø¼Òµé Áß¿¡¼­ À妽º°¡ Ȧ¼öÀÎ°Í ¸ðµÎ ¹ÝȯÇÑ´Ù.

<!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(){
   $("tr:odd").css("background-color", "#bbbbff");
  });
  </script>
  <style>
  table {
   background:#f3f7f5;
  }
  </style>
</head>
<body>
  <table border="1">
   <tr><td>Row with Index #0</td></tr>
   <tr><td>Row with Index #1</td></tr>
   <tr><td>Row with Index #2</td></tr>
   <tr><td>Row with Index #3</td></tr>
  </table>
</body>
</html>



15. :eq(index)  Returns: Element
eq(À妽º), ½ÇÇàÈÄ ¿ø¼Ò  ¹Ýȯ

Matches a single element by its index.
¸ÅÄ¡µÈ ¿ø¼Òµé Áß¿¡¼­ ÁÖ¾îÁø À妽º¿¡ ¸ÅÄ¡µÇ´Â ¿ø¼Ò ÇÑ°³¸¦ ¹ÝȯÇÑ´Ù.

<!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(){
   $("td:eq(2)").css("text-decoration", "blink");
  });
  </script>

</head>
<body>
  <table border="1">
   <tr><td>TD #0</td><td>TD #1</td><td>TD #2</td></tr>
   <tr><td>TD #3</td><td>TD #4</td><td>TD #5</td></tr>
   <tr><td>TD #6</td><td>TD #7</td><td>TD #8</td></tr>
  </table>
</body>
</html>



16. :gt(index)  Returns: Array<Element>
ÃÊ°ú, ½ÇÇàÈÄ ¿ø¼Ò ¹è¿­ ¹Ýȯ

Matches all elements with an index above the given one.
¸ÅÄ¡µÈ ¿ø¼Òµé Áß¿¡¼­ À妽º·Î ÁÖ¾îÁø °Íº¸´Ù Å« À妽º µéÀ» ¸ðµÎ ¹è¿­·Î ¹Ýȯ

<!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(){
   $("td:gt(4)").css("text-decoration", "line-through");
  });
  </script>

</head>
<body>
  <table border="1">
   <tr><td>TD #0</td><td>TD #1</td><td>TD #2</td></tr>
   <tr><td>TD #3</td><td>TD #4</td><td>TD #5</td></tr>
   <tr><td>TD #6</td><td>TD #7</td><td>TD #8</td></tr>
  </table>
</body>
</html>



17. :lt(index)  Returns: Array<Element>
¹Ì¸¸, ½ÇÇàÈÄ ¿ø¼Ò ¹è¿­ ¹Ýȯ

Matches all elements with an index below the given one.
¸ÅÄ¡µÈ ¿ø¼Òµé Áß¿¡¼­ À妽º·Î ÁÖ¾îÁø °Íº¸´Ù ÀÛÀº À妽º µéÀ» ¸ðµÎ ¹è¿­·Î ¹Ýȯ

<!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(){
   $("td:lt(4)").css("color", "red");
  });
  </script>

</head>
<body>
  <table border="1">
   <tr><td>TD #0</td><td>TD #1</td><td>TD #2</td></tr>
   <tr><td>TD #3</td><td>TD #4</td><td>TD #5</td></tr>
   <tr><td>TD #6</td><td>TD #7</td><td>TD #8</td></tr>
  </table>
</body>
</html>



18. :header  Returns: Array<Element>
Çì´õ, ½ÇÇàÈÄ ¿ø¼Ò ¹è¿­ ¹Ýȯ

Matches all elements that are headers, like h1, h2, h3 and so on.
¸ÅÄ¡µÇ´Â ¿ø¼Òµé Áß¿¡¼­ h1, h2 ... ¿Í °°Àº Çì´õ ű׵éÀ» ¸ðµÎ ¹è¿­·Î ¹ÝȯÇÑ´Ù.

<!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(){
   $(":header").css({ background:'#CCC', color:'blue' });
  });
  </script>
  <style>
  body { font-size: 10px; font-family: Arial; }
  h1, h2 { margin: 3px 0; }
  </style>
</head>
<body>
  <h1>Header 1</h1>
  <p>Contents 1</p>
  <h2>Header 2</h2>
  <p>Contents 2</p>
</body>
</html>



19. :animated  Returns: Array<Element>
¿òÁ÷ÀδÙ, ½ÇÇàÈÄ ¿ø¼Ò ¹è¿­ ¹Ýȯ

Matches all elements that are currently being animated.
¸ÅÄ¡µÈ ¿ø¼Òµé Áß¿¡¼­ ¾Ö´Ï¸ÞÀ̼ÇÀÌ µ¿ÀÛÇÏ°í ÀÖ´Â °ÍµéÀ» ¸ðµÎ ¹ÝȯÇÑ´Ù.

<!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(){

   $("#run").click(function(){
     $("div:animated").toggleClass("colored");
   });
   function animateIt() {
     $("#mover").slideToggle("slow", animateIt);
   }
   animateIt();

  });
  </script>
  <style>
  div { background:yellow; border:1px solid #AAA; width:80px; height:80px; margin:5px; float:left; }
  div.colored { background:green; }
  </style>
</head>
<body>
  <button id="run">Run</button>
  <div></div>
  <div id="mover"></div>
  <div></div>
</body>
</html>



20. :contains(text)  Returns: Array<Element>
Æ÷ÇÔ, ½ÇÇàÈÄ ¿ø¼Ò ¹è¿­ ¹Ýȯ

Matches elements which contain the given text.
¸ÅÄ¡µÈ ¿ø¼Òµé Áß¿¡¼­ ÁÖ¾îÁø ÅؽºÆ®¸¦ Æ÷ÇÔÇÏ´Â °ÍµéÀ» ¸ðµÎ ¹è¿­·Î ¹ÝȯÇÑ´Ù.

<!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(){
   $("div:contains('John')").css("text-decoration", "underline");
  });
  </script>

</head>
<body>
  <div>John Resig</div>
  <div>George Martin</div>
  <div>Malcom John Sinclair</div>
  <div>J. Ohn
</body>
</html>



21. :empty  Returns: Array<Element>
ºñ¾ù´Ù. ½ÇÇàÈÄ ¿ø¼Ò ¹è¿­ ¹Ýȯ

Matches all elements that are empty, be it elements or text.
¸ÅÄ¡µÈ ¿ø¼Òµé Áß¿¡¼­ ÅؽºÆ®°¡ ºñ¾îÀÖ´Â °ÍµéÀ» ¸ðµÎ ¹è¿­·Î ¹ÝȯÇÑ´Ù.

<!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(){
   $("td:empty").text("Was empty!").css('background', 'rgb(255,220,200)');
  });
  </script>
  <style>
  td { text-align:center; }
  </style>
</head>
<body>
  <table border="1">
   <tr><td>TD #0</td><td></td></tr>
   <tr><td>TD #2</td><td></td></tr>
   <tr><td></td><td>TD#5</td></tr>
  </table>
</body>
</html>



22. :has(selector)  Returns: Array<Element>
has(selector), ½ÇÇàÈÄ ¿ø¼Ò ¹è¿­ ¹Ýȯ

Matches elements which contain at least one element that matches the specified selector.
¸ÅÄ¡µÈ ¿ø¼Òµé Áß¿¡¼­ ÁÖ¾îÁø °ÍÀ» Æ÷ÇÔÇÏ´Â °ÍÀ» ¸ðµÎ ¹è¿­·Î ¹ÝȯÇÑ´Ù.

<!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(){
   $("div:has(p)").addClass("test");
  });
  </script>
  <style>
  .test{ border: 3px inset red; }
  </style>
</head>
<body>
  <div><p>Hello in a paragraph</p></div>
  <div>Hello again! (with no paragraph)</div>
</body>
</html>



23. :parent  Returns: Array<Element>
ºÎ¸ð, ½ÇÇàÈÄ ¿ø¼Ò ¹è¿­ ¹Ýȯ

Matches all elements that are parents - they have child elements, including text.
ÁÖ¾îÁø °ÍÀÌ ºÎ¸ðÀÎ °ÍÀ» ¸ðµÎ ¹Þ¾Æ¿Â´Ù, ºñ¾îÀÖ´Â °ÍÀº Æ÷ÇÔ ¾ÈÇÔ

<!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(){
   $("td:parent").fadeTo(1500, 0.3);
  });
  </script>
  <style>
td { width:40px; background:green; }
  </style>
</head>
<body>
  <table border="1">
   <tr><td>Value 1</td><td></td></tr>
   <tr><td>Value 2</td><td></td></tr>
  </table>
</body>
</html>



24. :hidden  Returns: Array<Element>
¾Èº¸ÀÓ, ½ÇÇàÈÄ ¿ø¼Ò ¹è¿­ ¹Ýȯ

Matches all elements that are hidden, or input elements of type "hidden".
º¸ÀÌÁö ¾Ê´Â ¸ðµç °ÍµéÀ» ¹ÝȯÇÑ´Ù. none hidden  µî, Ãß°¡·Î inputÀ» ÁöÁ¤Çϸé ÀÎDzŸÀÔÀÌ È÷µçÀΰ͸¸ ¹Þ¾Æ¿Â´Ù

<!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(){

   // in some browsers :hidden includes head, title, script, etc... so limit to body
   $("span:first").text("Found " + $(":hidden", document.body).length +
                        " hidden elements total.");
   $("div:hidden").show(3000);
   $("span:last").text("Found " + $("input:hidden").length + " hidden inputs.");

  });
  </script>
  <style>
  div { width:70px; height:40px; background:#ee77ff; margin:5px; float:left; }
  span { display:block; clear:left; color:red; }
  .starthidden { display:none; }
  </style>
</head>
<body>
  <span></span>
  <div></div>
  <div style="display:none;">Hider!</div>
  <div></div>
  <div class="starthidden">Hider!</div>
  <div></div>
  <form>
   <input type="hidden" />
   <input type="hidden" />
   <input type="hidden" />
  </form>
  <span>
  </span>
</body>
</html>



25. :visible  Returns: Array<Element>
º¸ÀÓ, ½ÇÇàÈÄ ¿ø¼Ò ¹è¿­ ¹Ýȯ

Matches all elements that are visible.
º¸ÀÌ´Â °ÍµéÀ» ¸ðµÎ ¹ÝȯÇÑ´Ù.

<!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(){

   $("div:visible").click(function () {
     $(this).css("background", "yellow");
   });
   $("button").click(function () {
     $("div:hidden").show("fast");
   });

  });
  </script>
  <style>
  div { width:50px; height:40px; margin:5px; border:3px outset green; float:left; }
  .starthidden { display:none; }
  </style>
</head>
<body>
  <button>Show hidden to see they don't change</button>
  <div></div>
  <div class="starthidden"></div>
  <div></div>
  <div></div>
  <div style="display:none;"></div>
</body>
</html>



26. [attribute]  Returns: Array<Element>
¼Ó¼º, ½ÇÇàÈÄ ¿ø¼Ò ¹è¿­ ¹Ýȯ

Matches elements that have the specified attribute.
ÁÖ¾îÁø ¼Ó¼ºÀ» °¡Áø °ÍµéÀ» ¸ðµÎ ¹ÝȯÇÑ´Ù.

<!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(){

   $("div[id]").one("click", function(){
     var idString = $(this).text() + " = " + $(this).attr("id");
     $(this).text(idString);
   });

  });
  </script>

</head>
<body>
  <div>no id</div>
  <div id="hey">with id</div>
  <div id="there">has an id</div>
  <div>nope</div>
</body>
</html>



27. [attribute=value]  Returns: Array<Element>
¼Ó¼º=°ª, ½ÇÇàÈÄ ¿ø¼Ò ¹è¿­ ¹Ýȯ

Matches elements that have the specified attribute with a certain value.
ÁÖ¾îÁø ¼Ó¼º°ú ÁÖ¾îÁø °ªÀÌ ÀÏÄ¡ ÇÏ´Â ¸ðµç°ÍµéÀ» ¹ÝȯÇÑ´Ù.

<!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(){
   $("input[name='newsletter']").next().text(" is newsletter");
  });
  </script>

</head>
<body>
  <div>
   <input type="radio" name="newsletter" value="Hot Fuzz" />
   <span>name?</span>
  </div>
  <div>
   <input type="radio" name="newsletter" value="Cold Fusion" />
   <span>name?</span>
  </div>
  <div>
   <input type="radio" name="accept" value="Evil Plans" />
   <span>name?</span>
  </div>
</body>
</html>



28. [attribute!=value]  Returns: Array<Element>
¼Ó¼º!=°ª, ½ÇÇàÈÄ ¿ø¼Ò ¹è¿­ ¹Ýȯ

Matches elements that don't have the specified attribute with a certain value.
ÁÖ¾îÁø ¼Ó¼º°ú ÁÖ¾îÁø °ªÀÌ ÀÏÄ¡ ÇÏÁö ¾Ê´Â ¸ðµç°ÍµéÀ» ¹ÝȯÇÑ´Ù.

<!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(){
   $("input[name!='newsletter']").next().text(" is not newsletter");
  });
  </script>

</head>
<body>
  <div>
   <input type="radio" name="newsletter" value="Hot Fuzz" />
   <span>name?</span>
  </div>
  <div>
   <input type="radio" name="newsletter" value="Cold Fusion" />
   <span>name?</span>
  </div>
  <div>
   <input type="radio" name="accept" value="Evil Plans" />
   <span>name?</span>
  </div>
</body>
</html>



29. [attribute^=value]  Returns: Array<Element>
¼Ó¼º^=°ª, ½ÇÇàÈÄ ¿ø¼Ò ¹è¿­ ¹Ýȯ

Matches elements that have the specified attribute and it starts with a certain value.
ÁÖ¾îÁø ¼Ó¼ºÀ» °¡Áö¸ç °ªÀÌ ÁÖ¾îÁø °ªÀ¸·Î ½ÃÀ۵Ǵ ¸ðµç °ÍÀ» ¹ÝȯÇÑ´Ù.

<!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(){
   $("input[name^='news']").val("news here!");
  });
  </script>

</head>
<body>
  <input name="newsletter" />
  <input name="milkman" />
  <input name="newsboy" />
</body>
</html>



30. [attribute$=value]  Returns: Array<Element>
¼Ó¼º$=°ª, ½ÇÇàÈÄ ¿ø¼Ò ¹è¿­ ¹Ýȯ

Matches elements that have the specified attribute and it ends with a certain value.
ÁÖ¾îÁø ¼Ó¼ºÀ» °¡Áö¸ç °ªÀÌ ÁÖ¾îÁø °ªÀ¸·Î ³¡³ª´Â ¸ðµç °ÍÀ» ¹ÝȯÇÑ´Ù.

<!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(){
   $("input[name$='letter']").val("a letter");
  });
  </script>

</head>
<body>
  <input name="newsletter" />
  <input name="milkman" />
  <input name="jobletter" />
</body>
</html>



31. [attribute*=value]  Returns: Array<Element>
¼Ó¼º*=°ª, ½ÇÇàÈÄ ¿ø¼Ò ¹è¿­ ¹Ýȯ

Matches elements that have the specified attribute and it contains a certain value.
ÁÖ¾îÁø ¼Ó¼ºÀ» °¡Áö¸ç °ªÀÌ ÁÖ¾îÁø °ªÀ» Æ÷ÇÔÇÏ´Â ¸ðµç °ÍÀ» ¹ÝȯÇÑ´Ù.

<!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(){
   $("input[name*='man']").val("has man in it!");
  });
  </script>

</head>
<body>
  <input name="man-news" />
  <input name="milkman" />
  <input name="letterman2" />
  <input name="newmilk" />
</body>
</html>



32. [selector1][selector2][selectorN]  Returns: Array<Element>
¼Ó¼ºµé, ½ÇÇàÈÄ ¿ø¼Ò ¹è¿­ ¹Ýȯ

Matches elements that have the specified attribute and it contains a certain value.
¼Ó¼ºÀ» ¿©·¯°³ ÁöÁ¤ÇÒ¼öµµ ÀÖ´Ù. ¸ÅÄ¡µÇ´Â ¸ðµç °ÍÀ» ¹ÝȯÇÑ´Ù.

<!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(){
   $("input[id][name$='man']").val("only this one");
  });
  </script>

</head>
<body>
  <input id="man-news" name="man-news" />
  <input name="milkman" />
  <input id="letterman" name="new-letterman" />
  <input name="newmilk" />
</body>
</html>



33. :nth-child(index/even/odd/equation)  Returns: Array<Element>
¸î¹ø° ÀÚ½Ä, ½ÇÇàÈÄ ¿ø¼Ò ¹è¿­ ¹Ýȯ

Matches the nth-child of its parent or all its even or odd children.
À妽º³ª Å°¿öµå·Î ÀÚ½ÄÀ» ÁöÁ¤ÇÏ¿© ¸ÅÄ¡µÇ´Â °ÍÀº ¸ðµÎ ¹ÝȯÇÑ´Ù.

<!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(){
   $("ul li:nth-child(2)").append("<span> - 2nd!</span>");
  });
  </script>
  <style>
  div { float:left; }
  span { color:blue; }
  </style>
</head>
<body>
  <div><ul>
   <li>John</li>
   <li>Karl</li>
   <li>Brandon</li>
  </ul></div>
  <div><ul>
   <li>Sam</li>
  </ul></div>
  <div><ul>
   <li>Glen</li>
   <li>Tane</li>
   <li>Ralph</li>
   <li>David</li>
  </ul></div>
</body>
</html>



34. :first-child  Returns: Array<Element>
ù¹ø° ÀÚ½Ä, ½ÇÇàÈÄ ¿ø¼Ò ¹è¿­ ¹Ýȯ

Matches the first child of its parent.
ù¹ø° ÀڽĿ¡ ¸ÅÄ¡µÇ´Â ¸ðµç °ÍÀ» ¹ÝȯÇÑ´Ù.

<!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(){

   $("div span:first-child")
       .css("text-decoration", "underline")
       .hover(function () {
             $(this).addClass("sogreen");
           }, function () {
             $(this).removeClass("sogreen");
           });

  });
  </script>
  <style>
  span { color:#008; }
  span.sogreen { color:green; font-weight: bolder; }
  </style>
</head>
<body>
  <div>
   <span>John,</span>
   <span>Karl,</span>
   <span>Brandon</span>
  </div>
  <div>
   <span>Glen,</span>
   <span>Tane,</span>
   <span>Ralph</span>
  </div>
</body>
</html>



35. :last-child  Returns: Array<Element>
¸¶Áö¸· ÀÚ½Ä, ½ÇÇàÈÄ ¿ø¼Ò ¹è¿­ ¹Ýȯ

Matches the last child of its parent.
¸¶Áö¸· ÀڽĿ¡ ¸ÅÄ¡µÇ´Â ¸ðµç °ÍÀ» ¹ÝȯÇÑ´Ù.

<!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(){

   $("div span:last-child")
       .css({color:"red", fontSize:"80%"})
       .hover(function () {
             $(this).addClass("solast");
           }, function () {
             $(this).removeClass("solast");
           });

  });
  </script>
  <style>
  span.solast { text-decoration:line-through; }
  </style>
</head>
<body>
  <div>
   <span>John,</span>
   <span>Karl,</span>
   <span>Brandon,</span>
   <span>Sam</span>
  </div>
  <div>
   <span>Glen,</span>
   <span>Tane,</span>
   <span>Ralph,</span>
   <span>David</span>
  </div>
</body>
</html>



36. :only-child  Returns: Array<Element>
ÇϳªÀÇ ÀÚ½Ä, ½ÇÇàÈÄ ¿ø¼Ò ¹è¿­ ¹Ýȯ

Matches the only child of its parent.
ÇϳªÀÇ ÀÚ½ÄÀ¸·Î¸¸ ÀÌ·ç¾îÁø ¸ðµç °ÍÀ» ¹ÝȯÇÑ´Ù.

<!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(){
   $("div button:only-child").text("Alone").css("border", "2px blue solid");
  });
  </script>
  <style>
  div { width:100px; height:80px; margin:5px; float:left; background:#b9e }
  </style>
</head>
<body>
  <div>
   <button>Sibling!</button>
   <button>Sibling!</button>
  </div>
  <div>
   <button>Sibling!</button>
  </div>
  <div>
   None
  </div>
  <div>
   <button>Sibling!</button>
   <button>Sibling!</button>
   <button>Sibling!</button>
  </div>
  <div>
   <button>Sibling!</button>
  </div>
</body>
</html>


37. :input  Returns: Array<Element>
ÀÎDz, ½ÇÇàÈÄ ¿ø¼Ò ¹è¿­ ¹Ýȯ

Matches all input, textarea, select and button elements.
ÀÎDz, ÅؽºÆ®¿¡¸®¾î, ¼¿·ºÆ®¹Ú½º, ¹öÆ°µéÀ» ¸ðµÎ ¹ÝȯÇÑ´Ù.

<!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 allInputs = $(":input");
   var formChildren = $("form > *");
   $("div").text("Found " + allInputs.length + " inputs and the form has " +
                            formChildren.length + " children.")
           .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>



38. :text  Returns: Array<Element>
ÅؽºÆ®, ½ÇÇàÈÄ ¿ø¼Ò ¹è¿­ ¹Ýȯ

Matches all input elements of type text.
ÀÎDzŸÀÔÀÌ ÅؽºÆ®ÀÎ °ÍÀ» ¸ðµÎ ¹ÝȯÇÑ´Ù.

<!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 = $(":text").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>



39. :password  Returns: Array<Element>
Æнº¿öµå, ½ÇÇàÈÄ ¿ø¼Ò ¹è¿­ ¹Ýȯ

Matches all input elements of type password.
ÀÎDzŸÀÔÀÌ Æнº¿öµåÀÎ °ÍÀ» ¸ðµÎ ¹ÝȯÇÑ´Ù.

<!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>



40. :radio  Returns: Array<Element>
·¹µð¿À, ½ÇÇàÈÄ ¿ø¼Ò ¹è¿­ ¹Ýȯ

Matches all input elements of type radio.
ÀÎDzŸÀÔÀÌ ·¹µð¿ÀÀÎ °ÍÀ» ¸ðµÎ ¹ÝȯÇÑ´Ù.

<!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 = $(":radio").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" name="asdf" />
   <input type="radio" name="asdf" />
   <input type="reset" />
   <input type="submit" />
   <input type="text" />
   <select><option>Option<option/></select>
   <textarea></textarea>
   <button>Button</button>
  </form>
  <div>
  </div>
</body>



41. :checkbox  Returns: Array<Element>
üũ¹Ú½º, ½ÇÇàÈÄ ¿ø¼Ò ¹è¿­ ¹Ýȯ

Matches all input elements of type checkbox.
ÀÎDzŸÀÔÀÌ Ã¼Å©¹Ú½ºÀÎ °ÍÀ» ¸ðµÎ ¹ÝȯÇÑ´Ù.

<!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 = $(":checkbox").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="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>



42. :submit  Returns: Array<Element>
¼­ºê¹Ô, ½ÇÇàÈÄ ¿ø¼Ò ¹è¿­ ¹Ýȯ

Matches all input elements of type submit.
ÀÎDzŸÀÔÀÌ ¼­ºê¹ÔÀÎ °ÍÀ» ¸ðµÎ ¹ÝȯÇÑ´Ù.

<!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 = $(":submit").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>



43. :image  Returns: Array<Element>
À̹ÌÁö, ½ÇÇàÈÄ ¿ø¼Ò ¹è¿­ ¹Ýȯ

Matches all input elements of type image.
ÀÎDzŸÀÔÀÌ À̹ÌÁöÀÎ °ÍÀ» ¸ðµÎ ¹ÝȯÇÑ´Ù.

<!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 = $(":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>
  <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>



44.  :reset  Returns: Array<Element>
¸®¼Â, ½ÇÇàÈÄ ¿ø¼Ò ¹è¿­ ¹Ýȯ

Matches all input elements of type reset.
ÀÎDzŸÀÔÀÌ ¸®¼ÂÀÎ °ÍÀ» ¸ðµÎ ¹ÝȯÇÑ´Ù.

<!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 = $(":reset").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>



45. :button  Returns: Array<Element>
¹öÆ°, ½ÇÇàÈÄ ¿ø¼Ò ¹è¿­ ¹Ýȯ

Matches all input elements of type button.
ÀÎDzŸÀÔÀÌ ¹öÆ°ÀÎ °ÍÀ» ¸ðµÎ ¹ÝȯÇÑ´Ù.

<!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 = $(":button").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>



46. :file  Returns: Array<Element>
ÆÄÀÏ, ½ÇÇàÈÄ ¿ø¼Ò ¹è¿­ ¹Ýȯ

Matches all input elements of type file.
ÀÎDzŸÀÔÀÌ ÆÄÀÏÀÎ °ÍÀ» ¸ðµÎ ¹ÝȯÇÑ´Ù.

<!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 = $(":file").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>



47. :hidden  Returns: Array<Element>
È÷µç, ½ÇÇàÈÄ ¿ø¼Ò ¹è¿­ ¹Ýȯ

Matches all elements that are hidden, or input elements of type "hidden".
ÀÎDzŸÀÔÀÌ È÷µçÀÎ °ÍÀ» ¸ðµÎ ¹ÝȯÇÑ´Ù.

<!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(){

   // in some browsers :hidden includes head, title, script, etc... so limit to body
   $("span:first").text("Found " + $(":hidden", document.body).length +
                        " hidden elements total.");
   $("div:hidden").show(3000);
   $("span:last").text("Found " + $("input:hidden").length + " hidden inputs.");

  });
  </script>
  <style>
  div { width:70px; height:40px; background:#ee77ff; margin:5px; float:left; }
  span { display:block; clear:left; color:red; }
  .starthidden { display:none; }
  </style>
</head>
<body>
  <span></span>
  <div></div>
  <div style="display:none;">Hider!</div>
  <div></div>
  <div class="starthidden">Hider!</div>
  <div></div>
  <form>
   <input type="hidden" />
   <input type="hidden" />
   <input type="hidden" />
  </form>
  <span>
  </span>
</body>
</html>



48. :enabled  Returns: Array<Element>
È°¼ºÈ­? »ç¿ë°¡´É?, ½ÇÇàÈÄ ¿ø¼Ò ¹è¿­ ¹Ýȯ

Matches all elements that are enabled.
È°¼ºÈ­µÈ ¸ðµç °ÍµéÀ» ¹ÝȯÇÑ´Ù.

<!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(){
   $("input:enabled").val("this is it");
  });
  </script>

</head>
<body>
  <form>
   <input name="email" disabled="disabled" />
   <input name="id" />
  </form>
</body>
</html>



49. :disabled  Returns: Array<Element>
ºñÈ°¼ºÈ­? »ç¿ëºÒ°¡´É?, ½ÇÇàÈÄ ¿ø¼Ò ¹è¿­ ¹Ýȯ

Matches all elements that are disabled.
ºñÈ°¼ºÈ­µÈ ¸ðµç °ÍµéÀ» ¹ÝȯÇÑ´Ù.

<!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(){
   $("input:disabled").val("this is it");
  });
  </script>

</head>
<body>
  <form>
   <input name="email" disabled="disabled" />
   <input name="id" />
  </form>
</body>
</html>



50. :checked  Returns: Array<Element>
üũ됏À½, ½ÇÇàÈÄ ¿ø¼Ò ¹è¿­ ¹Ýȯ

Matches all elements that are checked.
ÀÎDzÀÌ Ã¼Å©µÈ ¸ðµç °ÍµéÀ» ¹ÝȯÇÑ´Ù.

<!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(){

   function countChecked() {
     var n = $("input:checked").length;
     $("div").text(n + (n == 1 ? " is" : " are") + " checked!");
   }
   countChecked();
   $(":checkbox").click(countChecked);

  });
  </script>
  <style>
  div { color:red; }
  </style>
</head>
<body>
  <form>
   <input type="checkbox" name="newsletter" checked="checked" value="Hourly" />
   <input type="checkbox" name="newsletter" value="Daily" />
   <input type="checkbox" name="newsletter" value="Weekly" />
   <input type="checkbox" name="newsletter" checked="checked" value="Monthly" />
   <input type="checkbox" name="newsletter" value="Yearly" />
  </form>
  <div></div>
</body>
</html>



51. :selected  Returns: Array<Element>
¼±ÅõǾîÁü, ½ÇÇàÈÄ ¿ø¼Ò ¹è¿­ ¹Ýȯ

Matches all elements that are selected.
¼±ÅÃµÈ ¸ðµç °ÍÀ» ¹ÝȯÇÑ´Ù.

<!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(){

   $("select").change(function () {
         var str = "";
         $("select option:selected").each(function () {
               str += $(this).text() + " ";
             });
         $("div").text(str);
       })
       .trigger('change');

  });
  </script>
  <style>
  div { color:red; }
  </style>
</head>
<body>
  <select name="garden" multiple="multiple">
   <option>Flowers</option>
   <option selected="selected">Shrubs</option>
   <option>Trees</option>
   <option selected="selected">Bushes</option>
   <option>Grass</option>
   <option>Dirt</option>
  </select>
  <div></div>
</body>
</html>





<Attributes>

1. attr( name )  Returns: Object
¼Ó¼º ½ÇÇàÈÄ °´Ã¼ ¹Ýȯ

Access a property on the first matched element. This method makes it easy to retrieve a property value from the first matched element. If the element does not have an attribute with such a name, undefined is returned.
ÁÖ¾îÁø ¼Ó¼º¸íÀÇ °ªÀ» °¡Á®¿È, ¸ÅÄ¡µÇ´Â ù¹ø° °Í¸¸ °¡Á®¿È

<!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 title = $("em").attr("title");
   $("div").text(title);

  });
  </script>
  <style>
  em { color:blue; font-weight;bold; }
  div { color:red; }
  </style>
</head>
<body>
  <p>
   Once there was a <em title="huge, gigantic">large</em> dinosaur...
  </p>
  The title of the emphasis is:<div></div>
</body>
</html>



2. attr( properties )  Returns: jQuery
attr(¼Ó¼º¹è¿­) ½ÇÇàÈÄ jQuery°´Ã¼¸¦ ¹Ýȯ

Set a key/value object as properties to all matched elements.
¼Ó¼º°ú °ªµéÀÇ ¹è¿­À» ÁöÁ¤ÇÏ¿© Àû¿ë

<!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(){

   $("img").attr({
         src: "/images/hat.gif",
         title: "jQuery",
         alt: "jQuery Logo"
       });
   $("div").text($("img").attr("alt"));

  });
  </script>
  <style>
  img { padding:10px; }
  div { color:red; font-size:24px; }
  </style>
</head>
<body>
  <img />
  <img />
  <img />
  <div></div>
</body>
</html>



3. attr( key, value )  Returns: jQuery
attr( ¼Ó¼º, °ª ) ½ÇÇàÈÄ jQuery°´Ã¼¸¦ ¹Ýȯ

Set a single property to a value, on all matched elements.
ÇϳªÀÇ ¼Ó¼º°ú ÇϳªÀÇ °ª¸¸ ÁöÁ¤ÇÏ¿© Àû¿ë

<!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(){
   $("button:gt(0)").attr("disabled","disabled");
  });
  </script>
  <style>
  button { margin:10px; }
  </style>
</head>
<body>
  <button>0th Button</button>
  <button>1st Button</button>
  <button>2nd Button</button>
</body>
</html>



4. attr( key, fn )  Returns: jQuery
attr(¼Ó¼º, ÄݹéÇÔ¼ö) ½ÇÇàÈÄ jQuery °´Ã¼¸¦ ¹Ýȯ

Set a single property to a computed value, on all matched elements.
ÇϳªÀÇ ¼Ó¼º°ú ÄݹéÇÔ¼ö¸¦ ÁöÁ¤ÇÏ¿© Àû¿ë

<!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(){

   $("img").attr("src", function() {
         return "/images/" + this.title;
       });

  });
  </script>

</head>
<body>
  <img title="hat.gif"/>
  <img title="hat-old.gif"/>
  <img title="hat2-old.gif"/>
</body>
</html>



5. removeAttr( name )  Returns: jQuery
¼Ó¼º Á¦°Å ½ÇÇàÈÄ jQuery °´Ã¼¸¦ ¹Ýȯ

Remove an attribute from each of the matched elements.
ÁÖ¾îÁø À̸§°ú ¸ÅÄ¡µÇ´Â ¼Ó¼ºÀ» Á¦°Å

<!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(){

   $("button").click(function () {
     $(this).next().removeAttr("disabled")
            .focus()
            .val("editable now");
   });

  });
  </script>

</head>
<body>
  <button>Enable</button>
  <input type="text" disabled="disabled" value="can't edit this" />
</body>
</html>



6. addClass( class )  Returns: jQuery
Ŭ·¡½º Ãß°¡ ½ÇÇàÈÄ jQuery °´Ã¼ ¹Ýȯ

Adds the specified class(es) to each of the set of matched elements.
ÁÖ¾îÁø Ŭ·¡½º Àû¿ë

<!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(){
   $("p:last").addClass("selected");
  });
  </script>
  <style>
  p { margin: 8px; font-size:16px; }
  .selected { color:red; }
  .highlight { background:yellow; }
  </style>
</head>
<body>
  <p>Hello</p>
  <p>and</p>
  <p>Goodbye</p>
</body>
</html>



7. removeClass( class )  Returns: jQuery
Ŭ·¡½º Á¦°Å ½ÇÇàÈÄ JQuery °´Ã¼¸¦ ¸®ÅÏ

Removes all or the specified class(es) from the set of matched elements.
ÁÖ¾îÁø Ŭ·¡½º Á¦°Å

<!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(){
   $("p:even").removeClass("blue");
  });
  </script>
  <style>
  p { margin: 4px; font-size:16px; font-weight:bolder; }
  .blue { color:blue; }
  .under { text-decoration:underline; }
  .highlight { background:yellow; }
  </style>
</head>
<body>
  <p class="blue under">Hello</p>
  <p class="blue under highlight">and</p>
  <p class="blue under">then</p>
  <p class="blue under">Goodbye</p>
</body>
</html>



8. toggleClass( class )  Returns: jQuery
Ŭ·¡½º Ãß°¡ »èÁ¦ ¹Ýº¹ ½ÇÇàÈÄ jQuery °´Ã¼ ¸®ÅÏ

Adds the specified class if it is not present, removes the specified class if it is present.
ÁÖ¾îÁø Ŭ·¡½º¸¦ Ãß°¡ »èÁ¦¸¦ ¹Ýº¹ÇÑ´Ù.

<!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(){

   $("p").click(function () {
     $(this).toggleClass("highlight");
   });

  });
  </script>
  <style>
  p { margin: 4px; font-size:16px; font-weight:bolder;
     cursor:pointer; }
  .blue { color:blue; }
  .highlight { background:yellow; }
  </style>
</head>
<body>
  <p class="blue">Click to toggle</p>
  <p class="blue highlight">highlight</p>
  <p class="blue">on these</p>
  <p class="blue">paragraphs</p>
</body>
</html>



9. html( )  Returns: String
½ÇÇàÈÄ ¹®ÀÚ¿­À» ¹Ýȯ

Get the html contents (innerHTML) of the first matched element. This property is not available on XML documents (although it will work for XHTML documents).
¼±ÅõǾîÁø °´Ã¼ÀÇ htmlÀ» ¹ÝȯÇÑ´Ù.

<!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(){

   $("p").click(function () {
     var htmlStr = $(this).html();
     $(this).text(htmlStr);
   });

  });
  </script>
  <style>
  p { margin:8px; font-size:20px; color:blue;
     cursor:pointer; }
  b { text-decoration:underline; }
  button { cursor:pointer; }
  </style>
</head>
<body>
  <p>
   <b>Click</b> to change the <span id="tag">html</span>
  </p>
  <p>
   to a <span id="text">text</span> node.
  </p>
  <p>
   This <button name="nada">button</button> does nothing.
  </p>
</body>
</html>



10. html( val )  Returns: jQuery
½ÇÇàÈÄ jQuery °´Ã¼¸¦ ¹Ýȯ

Set the html contents of every matched element. This property is not available on XML documents (although it will work for XHTML documents).
¸ÅÄ¡µÇ´Â ¸ðµç ¿ø¼Ò¿¡ ÁÖ¾îÁø htmlÀ» ³Ö´Â´Ù.

<!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(){
   $("div").html("<span class='red'>Hello <b>Again</b></span>");
  });
  </script>
  <style>
  .red { color:red; }
  </style>
</head>
<body>
  <span>Hello</span>
  <div></div>
  <div></div>
  <div></div>
</body>
</html>



11. text( )  Returns: String
½ÇÇàÈÄ ¹®ÀÚ¿­ ¹Ýȯ

Get the text contents of all matched elements.
¼±ÅõǾîÁø °´Ã¼ÀÇ ¹®ÀÚ¿­À» ¹ÝȯÇÑ´Ù. ű״ Á¦¿ÜµÈ´Ù.

<!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 str = $("p:first").text();
   $("p:last").html(str);

  });
  </script>
  <style>
  p { color:blue; margin:8px; }
  b { color:red; }
  </style>
</head>
<body>
  <p><b>Test</b> Paragraph.</p>
  <p></p>
</body>
</html>



12. text( val )  Returns: jQuery
½ÇÇàÈÄ jQuery °´Ã¼ ¹Ýȯ

Set the text contents of all matched elements.
¸ÅÄ¡µÇ´Â ¸ðµç ¿ø¼Ò¿¡ ÁÖ¾îÁø ÅؽºÆ®¸¦ Áý¾î³Ö´Â´Ù. htmlÀ» ³Ö´Â´Ù Çصµ ÅؽºÆ®È­ µÈ´Ù.

<!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(){
   $("p").text("<b>Some</b> new text.");
  });
  </script>
  <style>
  p { color:blue; margin:8px; }
  </style>
</head>
<body>
  <p>Test Paragraph.</p>
</body>
</html>



13. val( )  Returns: String, Array
½ÇÇàÈÄ ¹®ÀÚ¿­À̳ª ¹è¿­·Î ¹Ýȯ

Get the content of the value attribute of the first matched element.
ù¹ø° ¸ÅÄ¡µÇ´Â ¿ø¼ÒÀÇ °ªÀ» ¹ÝȯÇÑ´Ù.

<!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(){

   function displayVals() {
     var singleValues = $("#single").val();
     var multipleValues = $("#multiple").val() || [];
     $("p").html("<b>Single:</b> " +
                 singleValues +
                 " <b>Multiple:</b> " +
                 multipleValues.join(", "));
   }

   $("select").change(displayVals);
   displayVals();

  });
  </script>
  <style>
  p { color:red; margin:4px; }
  b { color:blue; }
  </style>
</head>
<body>
  <p></p>
  <select id="single">
   <option>Single</option>
   <option>Single2</option>
  </select>
  <select id="multiple" multiple="multiple">
   <option selected="selected">Multiple</option>
   <option>Multiple2</option>
   <option selected="selected">Multiple3</option>
  </select>
</body>
</html>



14. val( val )  Returns: jQuery
jQuery °´Ã¼¸¦ ¹Ýȯ

Set the value attribute of every matched element.
¸ÅÄ¡µÇ´Â ¸ðµç ¿ø¼Ò¿¡ ÁÖ¾îÁø °ªÀ» Àû¿ëÇÑ´Ù.

<!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(){

   $("button").click(function () {
     var text = $(this).text();
     $("input").val(text);
   });

  });
  </script>
  <style>
  button { margin:4px; cursor:pointer; }
  input { margin:4px; color:blue; }
  </style>
</head>
<body>
  <div>
   <button>Feed</button>
   <button>the</button>
   <button>Input</button>
  </div>
  <input type="text" value="click a button" />
</body>
</html>



15. val( val )
¹Ýȯ ¾øÀ½

Checks, or selects, all the radio buttons, checkboxes, and select options that match the set of values.
üũ ¹Ú½º, ¼¿·ºÆ® ¹Ú½º ·¹µð¿À ¹öÆ° ¼¿·ºÆ® ¿É¼Ç µî¿¡ °ªÀ» Àû¿ë
·¹µð¿À³ª üũ¹Ú½º °°Àº °æ¿ì´Â °ªÀ» ¿©·¯°³ ÁöÁ¤ÇÏ¿© ÇÒ¼ö ÀÖ´Ù.
¸ÖƼÇà °°Àº °æ¿ì ¹è¿­·Î¼­ °ªÀ» ÁöÁ¤ÇÒ¼ö ÀÖ´Ù.

<!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(){

   $("#single").val("Single2");
   $("#multiple").val(["Multiple2", "Multiple3"]);
   $("input").val(["check2", "radio1"]);

  });
  </script>
  <style>
  body { color:blue; }
  </style>
</head>
<body>
  <select id="single">
   <option>Single</option>
   <option>Single2</option>
  </select>
  <select id="multiple" multiple="multiple">
   <option selected="selected">Multiple</option>
   <option>Multiple2</option>
   <option selected="selected">Multiple3</option>
  </select><br/>
  <input type="checkbox" value="check1"/> check1
  <input type="checkbox" value="check2"/> check2
  <input type="radio" name="r" value="radio1"/> radio1
  <input type="radio" name="r" value="radio2"/> radio2
</body>
</html>




<Traversing>

1. eq( index )  Returns: jQuery
eq(À妽º) ½ÇÇàÈÄ jQuery °´Ã¼ ¹Ýȯ

Reduce the set of matched elements to a single element.
¸ÅÄ¡µÇ´Â ¿ø¼ÒÁß À妽º¿Í ÀÏÄ¡ÇÏ´Â °Í Çϳª¸¸ ¹ÝȯÇÑ´Ù.

<!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(){

   $("div").eq(2).addClass("red");

  });
  </script>
  <style>
  div { width:60px; height:60px; margin:10px; float:left;
       border:2px solid blue; }
  .red { background:red; }
  </style>
</head>
<body>
  <div></div>
  <div></div>
  <div></div>
  <div></div>
  <div></div>
  <div></div>
</body>
</html>



2. hasClass( class )  Returns: Boolean
Ŭ·¡½º°¡ ÀÖ³ª ¾ø³ª ½ÇÇàÈÄ Âü°ÅÁþ ¸®ÅÏ

Checks the current selection against a class and returns true, if at least one element of the selection has the given class.
¸ÅÄ¡µÇ´Â ¿ø¼Ò¿¡ ÁÖ¾îÁø Ŭ·¡½º°¡ Á¸ÀçÇϸé Âü, ¾Æ´Ï¸é °ÅÁþÀ» ¹ÝȯÇÑ´Ù.

<!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(){

   $("div").click(function(){
     if ( $(this).hasClass("protected") )
       $(this).animate({ left: -10 }, 75)
              .animate({ left: 10 }, 75)
              .animate({ left: -10 }, 75)
              .animate({ left: 10 }, 75)
              .animate({ left: 0 }, 75);
   });

  });
  </script>
  <style>
  div { width: 80px; height: 80px; background: #abc;
       position: relative; border: 2px solid black;
       margin: 20px 0px; float: left; left:0 }
  div.protected { border-color: red; }
  span { display:block; float:left; width:20px;
        height:20px; }
  </style>
</head>
<body>
  <span></span><div class="protected"></div>
  <span></span><div></div>
  <span></span><div></div>
  <span></span><div class="protected"></div>
</body>
</html>



3. filter( expr )  Returns: jQuery
½ÇÇàÈÄ jQuery °´Ã¼¸¦ ¹Ýȯ

Removes all elements from the set of matched elements that do not match the specified expression(s).
¸ÅÄ¡µÇ´Â ¿ø¼ÒµéÁß ÇØ´ç ÇÊÅÍ Ç¥Çö¿¡ ¸ÂÁö ¾Ê´Â °ÍµéÀº Á¦°ÅÇÏ°í ¹Ýȯ

<!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(){

   $("div").css("background", "#c8ebcc")
           .filter(".middle")
           .css("border-color", "red");

  });
  </script>
  <style>
  div { width:60px; height:60px; margin:5px; float:left;
       border:2px white solid;}
  </style>
</head>
<body>
  <div></div>
  <div class="middle"></div>
  <div class="middle"></div>
  <div class="middle"></div>
  <div class="middle"></div>
  <div></div>
</body>
</html>



4. filter( fn )  Returns: jQuery
filter(ÇÔ¼ö) ½ÇÇàÈÄ jQuery °´Ã¼¸¦ ¹Ýȯ

Removes all elements from the set of matched elements that does not match the specified function.
¸ÅÄ¡µÇ´Â ¿ø¼ÒµéÁß ÇØ´ç ÇÊÅÍ ÇÔ¼ö¿¡ ¸ÂÁö ¾Ê´Â °ÍµéÀº Á¦°ÅÇÏ°í ¹Ýȯ

<!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(){

   $("div").css("background", "#b4b0da")
           .filter(function (index) {
                 return index == 1 || $(this).attr("id") == "fourth";
               })
           .css("border", "3px double red");

  });
  </script>
  <style>
  div { width:60px; height:60px; margin:5px; float:left;
       border:3px white solid; }
  </style>
</head>
<body>
  <div id="first"></div>
  <div id="second"></div>
  <div id="third"></div>
  <div id="fourth"></div>
  <div id="fifth"></div>
  <div id="sixth"></div>
</body>
</html>



5. is( expr )  Returns: Boolean
Á¸Àç ¿©ºÎ ½ÇÇàÈÄ Âü°ÅÁþ ¹Ýȯ

Checks the current selection against an expression and returns true, if at least one element of the selection fits the given expression.
¸ÅÄ¡µÇ´Â ¿ø¼ÒµéÁß ÁÖ¾îÁø Ç¥Çö½Ä°ú ºñ±³ÇÏ¿© ÀÏÄ¡ Çϸé Âü, ±×·¸Áö ¾ÊÀ¸¸é °ÅÁþÀ» ¹ÝȯÇÑ´Ù.

<!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(){

   $("div").one('click', function () {
     if ($(this).is(":first-child")) {
       $("p").text("It's the first div.");
     } else if ($(this).is(".blue,.red")) {
       $("p").text("It's a blue or red div.");
     } else if ($(this).is(":contains('Peter')")) {
       $("p").text("It's Peter!");
     } else {
       $("p").html("It's nothing <em>special</em>.");
     }
     $("p").hide().slideDown("slow");
     $(this).css({"border-style": "inset", cursor:"default"});
   });

  });
  </script>
  <style>
  div { width:60px; height:60px; margin:5px; float:left;
       border:4px outset; background:green; text-align:center;
       font-weight:bolder; cursor:pointer; }
  .blue { background:blue; }
  .red { background:red; }
  span { color:white; font-size:16px; }
  p { color:red; font-weight:bolder; background:yellow;
     margin:3px; clear:left; display:none; }
  </style>
</head>
<body>
  <div></div>
  <div class="blue"></div>
  <div></div>
  <div class="red"></div>
  <div><br/><span>Peter</span></div>
  <div class="blue"></div>
  <p> </p>
</body>
</html>



16. map( callback )  Returns: jQuery
map(ÄݹéÇÔ¼ö) ½ÇÇàÈÄ jQuery  °´Ã¼ ¹Ýȯ

Translate a set of elements in the jQuery object into another set of values in an array (which may, or may not, be elements).

<!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(){

   $("p").append( $("input").map(function(){
     return $(this).val();
   }).get().join(", ") );

  });
  </script>
  <style>
  p { color:red; }
  </style>
</head>
<body>
  <p><b>Values: </b></p>
  <form>
   <input type="text" name="name" value="John"/>
   <input type="text" name="password" value="password"/>
   <input type="text" name="url" value="http://ejohn.org/"/>
  </form>
</body>
</html>



17. not( expr )  Returns: jQuery
½ÇÇàÈÄ jQuery °´Ã¼ ¹Ýȯ

Removes elements matching the specified expression from the set of matched elements.
¸ÅÄ¡µÇ´Â ¿ø¼ÒµéÁß Ç¥Çö½Ä°ú ÀÏÄ¡ ÇÏ´Â ¿ø¼Ò´Â Á¦°Å ÇÏ°í ¹ÝȯÇÑ´Ù.

<!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(){

   $("div").not(".green, #blueone")
           .css("border-color", "red");

  });
  </script>
  <style>
  div { width:60px; height:60px; margin:10px; float:left;
       background:yellow; border:2px solid white; }
  .green { background:#8f8; }
  .gray { background:#ccc; }
  #blueone { background:#99f; }
  </style>
</head>
<body>
  <div></div>
  <div id="blueone"></div>
  <div></div>
  <div class="green"></div>
  <div class="green"></div>
  <div class="gray"></div>
  <div></div>
</body>
</html>



18. slice( start, end )  Returns: jQuery
Selects a subset of the matched elements.
¸ÅÄ¡µÇ¾îÁø ¿ø¼Òµé Áß¿¡¼­ ÇØ´ç ½ÃÀÛÀ妽º¿Í ³¡ À妽ºÀÇ ¹üÀ§¿¡ ÀÖ´Â À妽ºÀÇ ¿ø¼ÒµéÀ» ¸ðµÎ ¹è¿­·Î ¹ÝȯÇÑ´Ù.
³¡ À妽º¸¦ ÁöÁ¤ÇÏÁö ¾ÊÀ¸¸é ½ÃÀÛÀ妽º ºÎÅÍ ³¡±îÁö ¹è¿­·Î ¹ÝȯÇÑ´Ù.

<!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(){
  
   function colorEm() {
     var $div = $("div");
     var start = Math.floor(Math.random() *
                            $div.length);
     var end = Math.floor(Math.random() *
                          ($div.length - start)) +
                          start + 1;
     if (end == $div.length) end = undefined;
     $div.css("background", "");
     if (end)
       $div.slice(start, end).css("background", "yellow");  
      else
       $div.slice(start).css("background", "yellow");
    
     $("span").text('$("div").slice(' + start +
                    (end ? ', ' + end : '') +
                    ').css("background", "yellow");');
   }

   $("button").click(colorEm);

  });
  </script>
  <style>
  div { width:40px; height:40px; margin:10px; float:left;
       border:2px solid blue; }
  span { color:red; font-weight:bold; }
  button { margin:5px; }
  </style>
</head>
<body>
  <button>Turn slice yellow</button>
  <span>Click the button!</span>
  <div></div>
  <div></div>
  <div></div>
  <div></div>
  <div></div>
  <div></div>
  <div></div>
  <div></div>
  <div></div>
</body>
</html>



19. add( expr )  Returns: jQuery
add( expr ), ½ÇÇàÈÄ jQuery °´Ã¼ ¹Ýȯ

Adds more elements, matched by the given expression, to the set of matched elements.
¸ÅÄ¡µÈ ¿ø¼Ò¿¡ »õ·Î¿î ¿ø¼Ò³ª ¿ø¼ÒµéÀ» Ãß°¡ÇÑ´Ù.

<!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(){
  
   $("div").css("border", "2px solid red")
           .add("p")
           .css("background", "yellow");

  });
  </script>
  <style>
  div { width:60px; height:60px; margin:10px; float:left; }
  p { clear:left; font-weight:bold; font-size:16px;
     color:blue; margin:0 10px; padding:2px; }
  </style>
</head>
<body>
  <div></div>
  <div></div>
  <div></div>
  <div></div>
  <div></div>
  <div></div>
  <p>Added this... (notice no border)</p>
</body>
</html>



20. children( expr )  Returns: jQuery
children( expr ), ½ÇÇàÈÄ jQuery °´Ã¼ ¹Ýȯ

Get a set of elements containing all of the unique children of each of the matched set of elements.
¼±ÅõǾîÁø ¿ø¼ÒÀÇ ÀڽĵéÀ» ¹Ýȯ
ÀÌÇØ°¡ Àß ¾ÈµÊ

<!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(){
  
   $("#container").click(function (e) {
     $("*").removeClass("hilite");
     var $kids = $(e.target).children();
     var len = $kids.addClass("hilite").length;

     $("#results span:first").text(len);
     $("#results span:last").text(e.target.tagName);

     e.preventDefault();
     return false;
   });

  });
  </script>
  <style>
  body { font-size:16px; font-weight:bolder; }
  div { width:130px; height:82px; margin:10px; float:left;
       border:1px solid blue; padding:4px; }
  #container { width:auto; height:105px; margin:0; float:none;
       border:none; }
  .hilite { border-color:red; }
  #results { display:block; color:red; }
  p { margin:10px; border:1px solid transparent; }
  span { color:blue; border:1px solid transparent; }
  input { width:100px; }
  em { border:1px solid transparent; }
  a { border:1px solid transparent; }
  b { border:1px solid transparent; }
  button { border:1px solid transparent; }
  </style>
</head>
<body>
  <div id="container">
   <div>
     <p>This <span>is the <em>way</em> we</span>
     write <em>the</em> demo,</p>
   </div>
   <div>
     <a href="#"><b>w</b>rit<b>e</b></a> the <span>demo,</span> <button>write
     the</button> demo,
   </div>
   <div>
     This <span>the way we <em>write</em> the <em>demo</em> so</span>
     <input type="text" value="early" /> in
   </div>
   <p>
     <span>t</span>he <span>m</span>orning.
     <span id="results">Found <span>0</span> children in <span>TAG</span>.</span>
   </p>
  </div>
</body>
</html>



21. contents( )  Returns: jQuery
contents( ), ½ÇÇàÈÄ jQuery °´Ã¼ ¹Ýȯ

Find all the child nodes inside the matched elements (including text nodes), or the content document, if the element is an iframe.
¸ÅÄ¡µÈ ¿ø¼ÒµéÁß¿¡¼­ ºñ¾îÀÖÁö ¾Ê´Â ÀڽĵéÀ» ¸ðµÎ °¡Á®¿È
ÀÌÇØ°¡ Àß ¾ÈµÊ

<!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(){
   $("p").contents().not("[@nodeType=1]").wrap("<b/>");
  });
  </script>
  
</head>
<body>
  <p>Hello <a href="Johnhttp://ejohn.org/">John</a>, how are you doing?</p>
</body>
</html>



22. find( expr )  Returns: jQuery
find( expr ), ½ÇÇàÈÄ jQuery °´Ã¼ ¹Ýȯ

Searches for all elements that match the specified expression. This method is a good way to find additional descendant elements with which to process.
¸ÅÄ¡µÇ¾îÁø ¿ø¼Òµé Áß¿¡¼­ ÁÖ¾îÁø °Í¿¡ ¸ÅÄ¡µÇ´Â °ÍÀ» ã¾Æ ±×°ÍµéÀ» ¸ðµÎ ¹è¿­·Î ¹ÝȯÇÑ´Ù.

<!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(){
   $("p").find("span").css('color','red');
  });
  </script>
  
</head>
<body>
  <p><span>Hello</span>, how are you?</p>
  <p>Me? I'm <span>good</span>.</p>
</body>
</html>



23. next( expr )  Returns: jQuery
next( expr ), ½ÇÇàÈÄ jQuery °´Ã¼ ¹Ýȯ

Get a set of elements containing the unique next siblings of each of the matched set of elements.
¸ÅÄ¡µÇ¾îÁø ¿ø¼Ò¿Í ÇüÁ¦ °ü°èÀÎ ¹Ù·Î ´ÙÀ½ ¿ø¼Ò¸¦ ã¾Æ °´Ã¼·Î ¹Ýȯ

<!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(){
  
   $("button").click(function () {
     var txt = $(this).text();
     $(this).next().text(txt);
   });

  });
  </script>
  <style>
  span { color:blue; font-weight:bold; }
  button { width:100px; }
  </style>
</head>
<body>
  <div><button>First</button> - <span></span></div>
  <div><button>Second</button> - <span></span></div>
  <div><button>Third</button> - <span></span></div>
</body>
</html>



24. nextAll( expr )  Returns: jQuery
nextAll( expr ), ½ÇÇàÈÄ jQuery °´Ã¼ ¹Ýȯ

Find all sibling elements after the current element.
ÇöÀç ¸ÅÄ¡µÇ¾îÁø ¿ø¼Ò¿Í ÇüÁ¦ °ü°è¿¡ ÀÖ´Â ¸ðµç ¿ø¼Ò¸¦ ã¾Æ °´Ã¼·Î ¹Ýȯ

<!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(){
   $("div:first").nextAll().addClass("after");
  });
  </script>
  <style>
  div { width: 80px; height: 80px; background: #abc;
       border: 2px solid black; margin: 10px; float: left; }
  div.after { border-color: red; }
  </style>
</head>
<body>
  <div></div>
  <div></div>
  <div></div>
  <div></div>
</body>
</html>



25. parent( expr )  Returns: jQuery
parent( expr ), ½ÇÇàÈÄ jQuery °´Ã¼ ¹Ýȯ

Get a set of elements containing the unique parents of the matched set of elements.
¸ÅÄ¡µÇ¾îÁø ¿ø¼ÒÀÇ À¯ÀÏÇÑ ºÎ¸ð¸¦ ã¾Æ °´Ã¼·Î ¹ÝȯÇÑ´Ù.

<!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(){
  
   $("*", document.body).each(function () {
     var parentTag = $(this).parent().get(0).tagName;
     $(this).prepend(document.createTextNode(parentTag + " > "));
   });

  });
  </script>
  <style>
  div,p { margin:10px; }
  </style>
</head>
<body>
  <div>div,
   <span>span, </span>
   <b>b </b>
  </div>
  <p>p,
   <span>span,
     <em>em </em>
   </span>
  </p>
  <div>div,
   <strong>strong,
     <span>span, </span>
     <em>em,
       <b>b, </b>
     </em>
   </strong>
   <b>b </b>
  </div>
</body>
</html>



26. parents( expr )  Returns: jQuery
parents( expr ), ½ÇÇàÈÄ jQuery °´Ã¼ ¹Ýȯ

Get a set of elements containing the unique ancestors of the matched set of elements (except for the root element).
¸ÅÄ¡µÇ¾îÁø ¿ø¼ÒÀÇ À¯ÀÏÇÑ Á¶»óµéÀ» ã¾Æ °´Ã¼·Î ¹ÝȯÇÑ´Ù.

The matched elements can be filtered with an optional expression.

<!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 parentEls = $("b").parents()
                         .map(function () {
                               return this.tagName;
                             })
                         .get().join(", ");
   $("b").append("<strong>" + parentEls + "</strong>");

  });
  </script>
  <style>
  b { color:blue; }
  strong { color:red; }
  </style>
</head>
<body>
  <div>
   <p>
     <span>
       <b>My parents are: </b>
     </span>
   </p>
  </div>
</body>
</html>




27. prev( expr )  Returns: jQuery
prev( expr ), ½ÇÇàÈÄ jQuery °´Ã¼ ¹Ýȯ

Get a set of elements containing the unique previous siblings of each of the matched set of elements.
¸ÅÄ¡µÇ¾îÁø ¿ø¼Ò º¸´Ù ¾Õ¿¡ ÀÖ´Â À¯´ÏÅ©ÇÑ ÇüÁ¦ ¿ø¼Ò¸¦ ã¾Æ °´Ã¼·Î ¹ÝȯÇÑ´Ù.

<!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 $curr = $("#start");
   $curr.css("background", "#f99");
   $("button").click(function () {
     $curr = $curr.prev();
     $("div").css("background", "");
     $curr.css("background", "#f99");
   });

  });
  </script>
  <style>
  div { width:40px; height:40px; margin:10px;
       float:left; border:2px blue solid;
       padding:2px; }
  span { font-size:14px; }
  p { clear:left; margin:10px; }
  </style>
</head>
<body>
  <div></div>
  <div></div>
  <div><span>has child</span></div>
  <div></div>
  <div></div>
  <div></div>
  <div id="start"></div>
  <div></div>
  <p><button>Go to Prev</button></p>
</body>
</html>



28. prevAll( expr )  Returns: jQuery
prevAll( expr ), ½ÇÇàÈÄ jQuery °´Ã¼ ¹Ýȯ

Find all sibling elements before the current element.
¸ÅÄ¡µÇ¾îÁø ¿ø¼Òº¸´Ù ÀÌÀü¿¡ ÀÖ´Â ¸ðµç ÇüÁ¦ ¿ø¼Ò¸¦ ã¾Æ °´Ã¼·Î ¹ÝȯÇÑ´Ù.

<!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(){
   $("div:last").prevAll().addClass("before");
  });
  </script>
  <style>
  div { width:70px; height:70px; background:#abc;
       border:2px solid black; margin:10px; float:left; }
  div.before { border-color: red; }
  </style>
</head>
<body>
  <div></div>
  <div></div>
  <div></div>
  <div></div>
</body>
</html>



29. siblings( expr )  Returns: jQuery
siblings( expr ), ½ÇÇàÈÄ jQuery °´Ã¼ ¹Ýȯ

Get a set of elements containing all of the unique siblings of each of the matched set of elements.
¸ÅÄ¡µÇ¾îÁø ¿ø¼ÒµéÀÇ ¸ðµç ÇüÁ¦ ¿ø¼ÒµéÀ» ã¾Æ ¹ÝȯÇÑ´Ù.

Can be filtered with an optional expressions.

<!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 len = $(".hilite").siblings()
                         .css("color", "red")
                         .length;
   $("b").text(len);

  });
  </script>
  <style>
  ul { float:left; margin:5px; font-size:16px; font-weight:bold; }
  p { color:blue; margin:10px 20px; font-size:16px; padding:5px;
     font-weight:bolder; }
  .hilite { background:yellow; }
</style>
</head>
<body>
  <ul>
   <li>One</li>
   <li>Two</li>
   <li class="hilite">Three</li>
   <li>Four</li>
  </ul>
  <ul>
   <li>Five</li>
   <li>Six</li>
   <li>Seven</li>
  </ul>
  <ul>
   <li>Eight</li>
   <li class="hilite">Nine</li>
   <li>Ten</li>
   <li class="hilite">Eleven</li>
  </ul>
  <p>Unique siblings: <b></b></p>
</body>
</html>



30. andSelf( )  Returns: jQuery
andSelf( ), ½ÇÇàÈÄ jQuery °´Ã¼ ¹Ýȯ

Add the previous selection to the current selection.
¸ÅÄ¡µÇ¾îÁø ¿ø¼ÒµéÀÇ »óÀ§ÀÇ ÇüÁ¦ ¿ø¼Òµé°ú Á¶»ó ¿ø¼Ò ¸ðµÎ¸¦ ã¾Æ Ãß°¡ÇÏ¿© °´Ã¼·Î ¹ÝȯÇÑ´Ù.
ÀÌÇØ°¡ Àß ¾ÈµÊ

<!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(){
  
   $("div").find("p").andSelf().addClass("border");
   $("div").find("p").addClass("background");

  });
  </script>
  <style>
  p, div { margin:5px; padding:5px; }
  .border { border: 2px solid red; }
  .background { background:yellow; }
  </style>
</head>
<body>
  <div>
   <p>First Paragraph</p>
   <p>Second Paragraph</p>
  </div>
</body>
</html>



31. end( )  Returns: jQuery
end( ), ½ÇÇàÈÄ jQuery °´Ã¼ ¹Ýȯ

Revert the most recent 'destructive' operation, changing the set of matched elements to its previous state (right before the destructive operation).
ÇöÀç º¸´Ù ÀÌÀüÀÇ ¸ÅÄ¡»óÅ·Πµ¹¾Æ°¡¼­ °´Ã¼¸¦ ¹Ýȯ
Àß ÀÌÇØ°¡ ¾ÈµÊ

<!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(){
  
   jQuery.fn.showTags = function (n) {
     var tags = this.map(function () {
                             return this.tagName;
                           })
                       .get().join(", ");
     $("b:eq(" + n + ")").text(tags);
     return this;
   };

   $("p").showTags(0)
         .find("span")
         .showTags(1)
         .css("background", "yellow")
         .end()
         .showTags(2)
         .css("font-style", "italic");

  });
  </script>
  <style>
  p, div { margin:1px; padding:1px; font-weight:bold;
          font-size:16px; }
  div { color:blue; }
  b { color:red; }
  </style>
</head>
<body>
  <p>
   Hi there <span>how</span> are you <span>doing</span>?
  </p>
  <p>
   This <span>span</span> is one of
   several <span>spans</span> in this
   <span>sentence</span>.
  </p>
  <div>
   Tags in jQuery object initially: <b></b>
  </div>
  <div>
   Tags in jQuery object after find: <b></b>
  </div>
  <div>
   Tags in jQuery object after end: <b></b>
  </div>
</body>
</html>




<Manipulation>

1. html( )  Returns: String
html( ), ½ÇÇàÈÄ ¹®ÀÚ¿­ ¹Ýȯ

Get the html contents (innerHTML) of the first matched element. This property is not available on XML documents (although it will work for XHTML documents).
¸ÅÄ¡µÇ¾îÁø ù¹ø° ¿ø¼ÒÀÇ htmlÀ» °¡Á®¿Í¼­ ¹Ýȯ

<!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(){
  
   $("p").click(function () {
     var htmlStr = $(this).html();
     $(this).text(htmlStr);
   });

  });
  </script>
  <style>
  p { margin:8px; font-size:20px; color:blue;
     cursor:pointer; }
  b { text-decoration:underline; }
  button { cursor:pointer; }
  </style>
</head>
<body>
  <p>
   <b>Click</b> to change the <span id="tag">html</span>
  </p>
  <p>
   to a <span id="text">text</span> node.
  </p>
  <p>
   This <button name="nada">button</button> does nothing.
  </p>
</body>
</html>




2. html( val )  Returns: jQuery
html( val ), ½ÇÇàÈÄ jQuery °´Ã¼ ¹Ýȯ

Set the html contents of every matched element. This property is not available on XML documents (although it will work for XHTML documents).

¸ÅÄ¡µÇ´Â ¸ðµç ¿ø¼Òµé¿¡°Ô ÁÖ¾îÁø htmlÀ» »ðÀÔÇÏ°í °´Ã¼¸¦ ¹ÝȯÇÑ´Ù.

<!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(){
   $("div").html("<span class='red'>Hello <b>Again</b></span>");
  });
  </script>
  <style>
  .red { color:red; }
  </style>
</head>
<body>
  <span>Hello</span>
  <div></div>
  <div></div>
  <div></div>
</body>
</html>



3. text( )  Returns: String
text( ), ½ÇÇàÈÄ ¹®ÀÚ¿­ ¹Ýȯ

Get the text contents of all matched elements.
¸ÅÄ¡µÇ¾îÁø ¿ø¼ÒÀÇ Å±׸¦ Á¦¿ÜÇÑ ¹®ÀÚ¿­¸¸ ¹ÝȯÇÑ´Ù.

<!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 str = $("p:first").text();
   $("p:last").html(str);

  });
  </script>
  <style>
  p { color:blue; margin:8px; }
  b { color:red; }
  </style>
</head>
<body>
  <p><b>Test</b> Paragraph.</p>
  <p></p>
</body>
</html>



4. text( val )  Returns: jQuery
text( val ), ½ÇÇàÈÄ jQuery °´Ã¼ ¹Ýȯ

Set the text contents of all matched elements.
¸ÅÄ¡µÈ ¿ø¼Òµé¿¡ ÁÖ¾îÁø ¹®ÀÚ¿­À» »ðÀÔÇÏ°í °´Ã¼¸¦ ¹ÝȯÇÑ´Ù.

<!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(){
   $("p").text("<b>Some</b> new text.");
  });
  </script>
  <style>
  p { color:blue; margin:8px; }
  </style>
</head>
<body>
  <p>Test Paragraph.</p>
</body>
</html>



5. append( content )  Returns: jQuery
append( content ) , ½ÇÇàÈÄ jQuery °´Ã¼ ¹Ýȯ

Append content to the inside of every matched element.
¸ÅÄ¡µÇ¾îÁø ¿ø¼Ò¿¡ ÁÖ¾îÁø ³»¿ëÀ» Ãß°¡·Î »ðÀÔÇÑ ÈÄ °´Ã¼ ¹Ýȯ

<!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(){
   $("p").append("<b>Hello</b>");
  });
  </script>
  <style>p { background:yellow; }</style>
</head>
<body>
  <p>I would like to say: </p>
</body>
</html>


6. appendTo( content )  Returns: jQuery
appendTo( content ), ½ÇÇàÈÄ jQuery °´Ã¼ ¹Ýȯ

Append all of the matched elements to another, specified, set of elements.
¸ÅÄ¡µÇ¾îÁø ¿ø¼ÒµéÀÇ ³»¿ëµéÀ» ÁÖ¾îÁø Á¶°Ç¿¡ ¸Â´Â ¿ø¼Ò¿¡ Ãß°¡·Î »ðÀÔÇÑÈÄ  °´Ã¼ ¹Ýȯ

<!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(){
   $("span").appendTo("#foo"); // check append() examples
  });
  </script>
  <style>#foo { background:yellow; }</style>
</head>
<body>
  <span>I have nothing more to say... </span>
  <div id="foo">FOO! </div>
</body>
</html>



7. prepend( content )  Returns: jQuery
prepend( content ), ½ÇÇàÈÄ jQuery °´Ã¼ ¹Ýȯ

Prepend content to the inside of every matched element.
¸ÅÄ¡µÇ¾îÁø ¿ø¼Òµé¿¡ ¸Ç¾Õ¿¡ ÁÖ¾îÁø ³»¿ëÀ» »ðÀÔÇÑÈÄ °´Ã¼¸¦ ¹Ýȯ

<!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(){
   $("p").prepend("<b>Hello </b>");
  });
  </script>
  <style>p { background:yellow; }</style>
</head>
<body>
  <p>there friend!</p>
  <p>amigo!</p>
</body>
</html>



8. prependTo( content )  Returns: jQuery
prependTo( content )  ½ÇÇàÈÄ jQuery °´Ã¼ ¹Ýȯ

Prepend all of the matched elements to another, specified, set of elements.
¸Å칮µÇ¾îÁø ¿ø¼ÒÀÇ ³»¿ëÀ» ÁÖ¾îÁø °Í¿¡ ¸ÅÄ¡µÇ´Â ¿ø¼ÒÀÇ ¸Ç¾Õ¿¡ Ãß°¡ »ðÀÔÇÑÈÄ °´Ã¼¸¦ ¹Ýȯ

<!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(){
   $("span").prependTo("#foo"); // check prepend() examples
  });
  </script>
  <style>div { background:yellow; }</style>
</head>
<body>
  <div id="foo">FOO!</div>
  <span>I have something to say... </span>
</body>
</html>



9. after( content )  Returns: jQuery
after( content ), ½ÇÇàÈÄ jQuery °´Ã¼¸¦ ¹Ýȯ

Insert content after each of the matched elements.
¸ÅÄ¡µÇ´Â ¸ðµç ¿ø¼ÒÀÇ µÚ¿¡ ÁÖ¾îÁø ³»¿ëÀ» »ðÀÔ

<!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(){
   $("p").after("<b>Hello</b>");
  });
  </script>
  <style>p { background:yellow; }</style>
</head>
<body>
  <p>I would like to say: </p>
</body>
</html>



10. before( content )  Returns: jQuery
before( content )  ½ÇÇàÈÄ jQuery °´Ã¼¸¦ ¹Ýȯ

Insert content before each of the matched elements.

¸ÅÄ¡µÇ´Â ¸ð´Â ¿ø¼ÒÀÇ ¾Õ¿¡ ÁÖ¾îÁø ³»¿ë »ðÀÔ
<!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(){
   $("p").before("<b>Hello</b>");
  });
  </script>
  <style>p { background:yellow; }</style>
</head>
<body>
  <p> is what I said...</p>
</body>
</html>



11. insertAfter( content )  Returns: jQuery
insertAfter( content ), ½ÇÇàÈÄ jQuery °´Ã¼ ¹Ýȯ

Insert all of the matched elements after another, specified, set of elements.
¸ÅÄ¡µÇ¾îÁø ¿ø¼ÒµéÀ» ÁÖ¾îÁø °Í¿¡ ¸ÅÄ¡µÇ´Â ¿ø¼ÒÀÇ µÚ¿¡ »ðÀÔÇÑ´Ù.

<!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(){
   $("p").insertAfter("#foo"); // check after() examples
  });
  </script>
  <style>#foo { background:yellow; }</style>
</head>
<body>
  <p> is what I said... </p><div id="foo">FOO!</div>
</body>
</html>



12. insertBefore( content )  Returns: jQuery
insertBefore( content ), ½ÇÇàÈÄ jQuery °´Ã¼ ¹Ýȯ

Insert all of the matched elements before another, specified, set of elements.
¸ÅÄ¡µÇ¾îÁø ¿ø¼Ò¾Õ¿¡ ÁÖ¾îÁø °Í¿¡ ¸ÅÄ¡µÈ ¿ø¼Ò¸¦ »ðÀÔÇÑ´Ù.

<!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(){
   $("p").insertBefore("#foo"); // check before() examples
  });
  </script>
  <style>#foo { background:yellow; }</style>
</head>
<body>
  <div id="foo">FOO!</div><p>I would like to say: </p>
</body>
</html>



13. wrap( html )  Returns: jQuery
wrap( html ), ½ÇÇàÈÄ jQuery °´Ã¼¸¦ ¹Ýȯ

Wrap all matched elements with a structure of other elements.
¸ÅÄ¡µÇ¾îÁø ¿ø¼Ò¸¦ ÁÖ¾îÁø html·Î¼­ °¨½ÑÈÄ °´Ã¼¸¦ ¹Ýȯ

<!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(){
   $("span").wrap("<div><div><p><em><b></b></em></p></div></div>");
  });
  </script>
  <style>
  div { border:2px blue solid; margin:2px; padding:2px; }
  p { background:yellow; margin:2px; padding:2px; }
  </style>
</head>
<body>
  <span>Span Text</span>
  <span>Another One</span>
</body>
</html>



14. wrap( elem )  Returns: jQuery
wrap( elem ), ½ÇÇàÈÄ jQuery °´Ã¼ ¹Ýȯ

Wrap all matched elements with a structure of other elements.
¸ÅÄ¡µÈ ¸ðµç ¿ø¼Ò¸¦ ÁÖ¾îÁø°Í¿¡ ¸ÅÄ¡µÇ´Â ¿ø¼Ò·Î °¨½Ñ´Ù.

<!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(){
   $("p").wrap(document.getElementById('content'));
  });
  </script>
  <style>#content { background:#9f9; }</style>
</head>
<body>
  <p>Test Paragraph.</p><div id="content"></div>
</body>
</html>



15. wrapAll( html )  Returns: jQuery
wrapAll( html )  ½ÇÇàÈÄ jQuery °´Ã¼ ¹Ýȯ

Wrap all the elements in the matched set into a single wrapper element.
¸ÅÄ¡µÇ´Â ¿ø¼ÒµéÀ» ÁÖ¾îÁø html·Î ¸ðµÎ Çϳª·Î °¨½Ñ´Ù.

<!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(){
   $("span").wrapAll("<div><div><p><em><b></b></em></p></div></div>");
  });
  </script>
  <style>
  div { border:2px blue solid; margin:2px; padding:2px; }
  p { background:yellow; margin:2px; padding:2px; }
  strong { color:red; }
  </style>
</head>
<body>
  <span>Span Text</span>
  <strong>What about me?</strong>
  <span>Another One</span>
</body>
</html>



16. wrapAll( elem )  Returns: jQuery
wrapAll( elem ), ½ÇÇàÈÄ jQuery °´Ã¼ ¹Ýȯ

Wrap all the elements in the matched set into a single wrapper element.
¸ÅÄ¡µÇ¾îÁø ¿ø¼ÒµéÀ» ÁÖ¾îÁø °Í¿¡ ¸ÅÄ¡µÇ´Â °ÍÀ¸·Î Çϳª·Î °¨½Ñ´Ù.

<!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(){
   $("p").wrapAll(document.createElement("div"));
  });
  </script>
  <style>
  div { border: 2px solid blue; }
  p { background:yellow; margin:4px; }
  </style>
</head>
<body>
  <p>Hello</p>
  <p>cruel</p>
  <p>World</p>
</body>
</html>




17. wrapInner( html )  Returns: jQuery
wrapInner( html ), ½ÇÇàÈÄ jQuery °´Ã¼ ¹Ýȯ

Wrap the inner child contents of each matched element (including text nodes) with an HTML structure.
¸ÅÄ¡µÇ¾îÁø ¿ø¼Ò ¼ÓÀÇ ³»¿ëÀ» ÁÖ¾îÁø °ÍÀ¸·Î °¨½Ñ´Ù

<!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(){
   $("body").wrapInner("<div><div><p><em><b></b></em></p></div></div>");
  });
  </script>
  <style>
  div { border:2px green solid; margin:2px; padding:2px; }
  p { background:yellow; margin:2px; padding:2px; }
  </style>
</head>
<body>
  Plain old text, or is it?
</body>
</html>



18. wrapInner( elem )  Returns: jQuery
wrapInner( elem ), ½ÇÇàÈÄ jQuery °´Ã¼¸¦ ¹Ýȯ

Wrap the inner child contents of each matched element (including text nodes) with a DOM element.
¸ÅÄ¡µÇ¾îÁø ¿ø¼Ò ¼ÓÀÇ ³»¿ëÀ» ÁÖ¾îÁø °Í¿¡ ¸ÅÄ¡µÈ°ÍÀ¸·Î °¨½Ñ´Ù.

<!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(){
   $("p").wrapInner(document.createElement("b"));
  });
  </script>
  <style>p { background:#9f9; }</style>
</head>
<body>
  <p>Hello</p>
  <p>cruel</p>
  <p>World</p>
</body>
</html>



19. replaceWith( content )  Returns: jQuery
replaceWith( content ), ½ÇÇàÈÄ jQuery °´Ã¼ ¹Ýȯ

Replaces all matched elements with the specified HTML or DOM elements.
¸ÅÄ¡µÇ¾îÁø ¿ø¼Ò¸¦ ÁÖ¾îÁø ³»¿ë°ú ġȯÇÑ´Ù.

<!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(){
  
   $("button").click(function () {
     $(this).replaceWith("<div>" + $(this).text() + "</div>");
   });

  });
  </script>
  <style>
  button { display:block; margin:3px; color:red; width:200px; }
  div { color:red; border:2px solid blue; width:200px;
       margin:3px; text-align:center; }
  </style>
</head>
<body>
  <button>First</button>
  <button>Second</button>
  <button>Third</button>
</body>
</html>



20. replaceAll( selector )  Returns: jQuery
replaceAll( selector ), ½ÇÇàÈÄ jQuery °´Ã¼ ¹Ýȯ

Replaces the elements matched by the specified selector with the matched elements.
¸ÅÄ¡µÇ¾îÁø °ÍµéÀ» ÁÖ¾îÁø °Í¿¡ ¸ÅÄ¡µÇ´Â °Í¿¡ ¸ðµÎ ¹Ù²Þ

<!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(){
   $("<b>Paragraph. </b>").replaceAll("p"); // check replaceWith() examples
  });
  </script>
  
</head>
<body>
  <p>Hello</p>
  <p>cruel</p>
  <p>World</p>
</body>
</html>



21. empty( )  Returns: jQuery
empty( )  ½ÇÇàÈÄ jQuery °´Ã¼ ¹Ýȯ

Remove all child nodes from the set of matched elements.
¸ÅÄ¡µÇ¾îÁø ¸ðµç °ÍµéÀ» ¾ø¾Ø´Ù.

<!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(){
  
   $("button").click(function () {
     $("p").empty();
   });

  });
  </script>
  <style>
  p { background:yellow; }
  </style>
</head>
<body>
  <p>
   Hello, <span>Person</span> <a href=";">and person</a>
  </p>
  <button>Call empty() on above paragraph</button>
</body>
</html>



22. remove( expr )  Returns: jQuery
remove( expr ), ½ÇÇàÈÄ jQuery °´Ã¼¸¦ ¹Ýȯ

Removes all matched elements from the DOM.
¸ÅÄ¡µÇ´Â ¸ðµç ¿ø¼Ò¸¦ ¿Å±â´Ù.

<!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(){
  
   $("button").click(function () {
     $("p").remove();
   });

  });
  </script>
  <style>p { background:yellow; margin:6px 0; }</style>
</head>
<body>
  <p>Hello</p>
  how are
  <p>you?</p>
  <button>Call remove() on paragraphs
</body>
</html>



23. clone( )  Returns: jQuery
clone( )  ½ÇÇàÈÄ jQuery °´Ã¼ ¹Ýȯ

Clone matched DOM Elements and select the clones.
¼±ÅõǾîÁø ¿ø¼Ò¸¦ º¹»ç

<!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(){
   $("b").clone().prependTo("p");
  });
  </script>
  
</head>
<body>
  <b>Hello</b><p>, how are you?</p>
</body>
</html>



24. clone( true )  Returns: jQuery
clone( true )  ½ÇÇàÈÄ jQuery °´Ã¼ ¹Ýȯ

Clone matched DOM Elements, and all their event handlers, and select the clones.
¿Ïº®ÇÑ º¹»ç

<!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(){
  
   $("button").click(function(){
     $(this).clone(true).insertAfter(this);
   });

  });
  </script>
  
</head>
<body>
  <button>Clone Me!</button>
</body>
</html>




<CSS>

1. css( name )  Returns: String
css( name )  ½ÇÇàÈÄ ¹®ÀÚ¿­ ¹Ýȯ

Return a style property on the first matched element.
¸ÅÄ¡µÈ ¿ø¼Ò¿¡¼­ ÁÖ¾îÁø ½ºÅ¸ÀÏ ¼Ó¼ºÀÌ ¹ß°ßµÇ¸é ±× °ªÀ» ¹Ýȯ

<!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(){
  
   $("div").click(function () {
     var color = $(this).css("background-color");
     $("#result").html("That div is <span style='color:" +
                        color + ";'>" + color + "</span>.");
   });

  });
  </script>
  <style>
  div { width:60px; height:60px; margin:5px; float:left; }
  </style>
</head>
<body>
  <span id="result"> </span>
  <div style="background-color:blue;"></div>
  <div style="background-color:rgb(15,99,30);"></div>
  <div style="background-color:#123456;"></div>
  <div style="background-color:#f11;"></div>
</body>
</html>


2. css( properties )  Returns: jQuery
css( properties )  ½ÇÇàÈÄ jQuery °´Ã¼ ¹Ýȯ

Set a key/value object as style properties to all matched elements.
¸ÅÄ¡µÇ¾îÁø ¸ðµç ¿ø¼Ò¿¡ ÁÖ¾îÁø Å°¿Í °ªÀ¸·Î ÀÌ·ç¾îÁø ¼Ó¼ºµéÀÇ ¹è¿­ÀÇ ½ºÅ¸ÀÏÀ» Àû¿ëÇÏ°í °´Ã¼¸¦ ¹Ýȯ

<!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(){
  
   $("p").hover(function () {
     $(this).css({ "background-color":"yellow", "font-weight":"bolder" });
   }, function () {
     var cssObj = {
       "background-color": "#ddd",
       "font-weight": "",
       color: "rgb(0,40,244)"
     }
     $(this).css(cssObj);
   });

  });
  </script>
  <style>
  p { color:green; }
  </style>
</head>
<body>
  <p>
   Move the mouse over a paragraph.
  </p>
  <p>
   Like this one or the one above.
  </p>
</body>
</html>



3. css( name, value )  Returns: jQuery
css( name, value )  ½ÇÇàÈÄ jQuery °´Ã¼ ¹Ýȯ

Set a single style property to a value on all matched elements.
ÇϳªÀÇ ¼Ó¼º°ú °ªÀ» ¹Þ¾Æ ¸ÅÄ¡µÇ¾îÁø ¸ðµç ¿ø¼Ò¿¡ Àû¿ë

<!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(){
  
   $("p").mouseover(function () {
     $(this).css("color","red");
   });

  });
  </script>
  <style>
  p { color:blue; width:200px; font-size:14px; }
  </style>
</head>
<body>
  <p>
   Just roll the mouse over me.
  </p>
  <p>
   Or me to see a color change.
  </p>
</body>
</html>



4. offset( )  Returns: Object{top,left}
offset( )  ½ÇÇàÈÄ Å¾°ú ·¹ÇÁÆ®¿¡ ÇØ´çÇÏ´Â À§Ä¡ Á¤º¸¸¦ ¹Ýȯ

Get the current offset of the first matched element relative to the viewport.

<!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 p = $("p:last");
var offset = p.offset();
p.html( "left: " + offset.left + ", top: " + offset.top );
  });
  </script>
  <style>
  p { margin-left:10px; }
  </style>
</head>
<body>
  <p>Hello</p><p>2nd Paragraph</p>
</body>
</html>



5. height( )  Returns: Integer
height( )  ½ÇÇàÈÄ Á¤¼öÇüÀ» ¹ÝȯÇÑ´Ù.

Get the current computed, pixel, height of the first matched element.
¸ÅÄ¡µÈ ù¹ø° ¿ø¼ÒÀÇ ³ôÀ̸¦ Çȼ¿·Î ¹ÝȯÇÑ´Ù.

<!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(){
  
   function showHeight(ele, h) {
     $("div").text("The height for the " + ele +
                   " is " + h + "px.");
   }
   $("#getp").click(function () {
     showHeight("paragraph", $("p").height());
   });
   $("#getd").click(function () {
     showHeight("document", $(document).height());
   });
   $("#getw").click(function () {
     showHeight("window", $(window).height());
   });

  });
  </script>
  <style>
  body { background:yellow; }
  button { font-size:12px; margin:2px; }
  p { width:150px; border:1px red solid; }
  div { color:red; font-weight:bold; }
  </style>
</head>
<body>
  <button id="getp">Get Paragraph Height</button>
  <button id="getd">Get Document Height</button>
  <button id="getw">Get Window Height</button>
  <div> </div>
  <p>
   Sample paragraph to test height
  </p>
</body>
</html>



6. height( val )  Returns: jQuery
height( val )  ½ÇÇàÈÄ jQuery °´Ã¼ ¹Ýȯ

Set the CSS height of every matched element.
¸ÅÄ¡µÇ´Â ¸ðµç ¿ø¼Ò¿¡ ÁÖ¾îÁø ³ôÀ̸¦ Àû¿ëÇÑ´Ù.

<!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(){
  
   $("div").one('click', function () {
     $(this).height(30)
            .css({cursor:"auto", backgroundColor:"green"});
   });

  });
  </script>
  <style>
  div { width:50px; height:70px; float:left; margin:5px;
       background:rgb(255,140,0); cursor:pointer; }
  </style>
</head>
<body>
  <div></div>
  <div></div>
  <div></div>
  <div></div>
  <div></div>
</body>
</html>



7. width( )  Returns: Integer
width( )  ½ÇÇàÈÄ Á¤¼öÇüÀ» ¹Ýȯ

Get the current computed, pixel, width of the first matched element.
¸ÅÄ¡µÇ´Â ù¹ø° ¿ø¼ÒÀÇ ³Êºñ¸¦ Çȼ¿·Î ¹Ýȯ

<!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(){
  
   function showWidth(ele, w) {
     $("div").text("The width for the " + ele +
                   " is " + w + "px.");
   }
   $("#getp").click(function () {
     showWidth("paragraph", $("p").width());
   });
   $("#getd").click(function () {
     showWidth("document", $(document).width());
   });
   $("#getw").click(function () {
     showWidth("window", $(window).width());
   });

  });
  </script>
  <style>
  body { background:yellow; }
  button { font-size:12px; margin:2px; }
  p { width:150px; border:1px red solid; }
  div { color:red; font-weight:bold;  }
  </style>
</head>
<body>
  <button id="getp">Get Paragraph Width</button>
  <button id="getd">Get Document Width</button>
  <button id="getw">Get Window Width</button>
  <div> </div>
  <p>
   Sample paragraph to test width
  </p>
</body>
</html>

8. width( val )  Returns: jQuery
width( val )  ½ÇÇàÈÄ jQuery °´Ã¼¸¦ ¹Ýȯ

Set the CSS width of every matched element.
¸ÅÄ¡µÇ´Â ¸ðµç ¿ø¼Ò¿¡ ÁÖ¾îÁø ³Êºñ¸¦ Àû¿ëÇÑ´Ù.

<!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(){
  
   $("div").one('click', function () {
     $(this).width(30)
            .css({cursor:"auto", "background-color":"blue"});
   });

  });
  </script>
  <style>
  div { width:70px; height:50px; float:left; margin:5px;
       background:red; cursor:pointer; }
  </style>
</head>
<body>
  <div></div>
  <div></div>
  <div></div>
  <div></div>
  <div></div>
</body>
</html>




<Events>

1. ready( fn )  Returns: jQuery
ready( fn )  ½ÇÇàÈÄ jQuery °´Ã¼¸¦ ¹Ýȯ

Binds a function to be executed whenever the DOM is ready to be traversed and manipulated.
¹®¼­°¡ Áغñ°¡ µÇ¸é ±× ½ÃÁ¡¿¡ ÇÔ¼ö¸¦ ½ÇÇà½ÃŲ´Ù.

<!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(){
   $("p").text("The DOM is now loaded and can be manipulated.");
  });
  </script>
  <style>p { color:red; }</style>
</head>
<body>
  <p>
  </p>
</body>
</html>



2. bind( type, data, fn )  Returns: jQuery
bind( type, data, fn )  ½ÇÇàÈÄ jQuery °´Ã¼¸¦ ¹Ýȯ

Binds a handler to a particular event (like click) for each matched element.
ÁöÁ¤µÈ À̺¥Æ®°¡ ÀϾ¶§±îÁö ±â´Ù·Ç´Ù°¡ ÇÔ¼ö ½ÇÇà

<!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(){
  
   $("p").bind("click", function(e){
     var str = "( " + e.pageX + ", " + e.pageY + " )";
     $("span").text("Click happened! " + str);
   });
   $("p").bind("dblclick", function(){
     $("span").text("Double-click happened in " + this.tagName);
   });

  });
  </script>
  <style>
  p { background:yellow; font-weight:bold; cursor:pointer;
     padding:5px; }
  span { color:red; }
  </style>
</head>
<body>
  <p>Click or double click here.</p>
  <span></span>
</body>
</html>



3. one( type, data, fn )  Returns: jQuery
one( type, data, fn )  ½ÇÇàÈÄ jQuery °´Ã¼ ¹Ýȯ

Binds a handler to a particular event to be executed once for each matched element.
ÁöÁ¤µÈ À̺¥Æ®°¡ ÀϾ¶§±îÁö ±â´Ù·Ç´Ù°¡ Çѹø¸¸ ½ÇÇà

<!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 n = 0;
   $("div").one("click", function(){
     var index = $("div").index(this);
     $(this).css({ borderStyle:"inset",
                   cursor:"auto" });
     $("p").text("Div at index #" + index + " clicked." +
                 "  That's " + ++n + " total clicks.");
   });

  });
  </script>
  <style>
  div { width:60px; height:60px; margin:5px; float:left;
       background:green; border:10px outset;
       cursor:pointer; }
  p { color:red; margin:0; clear:left; }
  </style>
</head>
<body>
  <div></div>
  <div></div>
  <div></div>
  <div></div>
  <div></div>
  <p>Click a green square...</p>
</body>
</html>



4. trigger( type, data )  Returns: jQuery
trigger( type, data )  ½ÇÇàÈÄ jQuery °´Ã¼ ¹Ýȯ

Trigger a type of event on every matched element.
¸ÅÄ¡µÇ´Â ¸ðµç ¿ø¼Ò¿¡ ÁöÁ¤µÈ ŸÀÔÀÇ À̺¥Æ®¸¦ ¹ß»ý½ÃŲ´Ù.

<!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(){
  
   $("button:first").click(function () {
     update($("span:first"));
   });
   $("button:last").click(function () {
     $("button:first").trigger('click');

     update($("span:last"));
   });

   function update(j) {
     var n = parseInt(j.text(), 0);
     j.text(n + 1);
   }

  });
  </script>
  <style>
  button { margin:10px; }
  div { color:blue; font-weight:bold; }
  span { color:red; }
  </style>
</head>
<body>
  <button>Button #1</button>
  <button>Button #2</button>
  <div><span>0</span> button #1 clicks.</div>
  <div><span>0</span> button #2 clicks.</div>
</body>
</html>



5. triggerHandler( type, data )  Returns: jQuery
triggerHandler( type, data )  ½ÇÇàÈÄ jQuery°´Ã¼ ¹Ýȯ

This particular method triggers all bound event handlers on an element (for a specific event type) WITHOUT executing the browsers default actions.
ÀßÀº ¸ð¸£°ÙÁö¸¸ ½ÇÁ¦ÀûÀÎ ÇàÀ§´Â ÇÏÁö ¾Ê°í ±×°á°ú¸¸ ½ÇÇàÇÑ´Ù´Â ¶æÀÎ°Í °°À½

<!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(){
  
   $("#old").click(function(){
     $("input").trigger("focus");
   });
   $("#new").click(function(){
     $("input").triggerHandler("focus");
   });
   $("input").focus(function(){
     $("<span>Focused!</span>").appendTo("body").fadeOut(1000);
   });

  });
  </script>
  
</head>
<body>
  <button id="old">.trigger("focus")</button>
  <button id="new">.triggerHandler("focus")</button><br/><br/>
  <input type="text" value="To Be Focused"/>
</body>
</html>




6. unbind( type, data )  Returns: jQuery
unbind( type, data ), ½ÇÇàÈÄ jQuery °´Ã¼ ¹Ýȯ

This does the opposite of bind, it removes bound events from each of the matched elements.
bind¿Í Á¤¹Ý´ëÀÇ ¿ªÈ°À» ÇÏ¸ç ¸ÅÄ¡µÇ´Â ¸ðµç ¿ø¼Ò¿¡ ¹Ù¿îµå À̺¥Æ®¸¦ Á¦°ÅÇÑ´Ù.

<!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(){
  
   function aClick() {
     $("div").show().fadeOut("slow");
   }
   $("#bind").click(function () {
     // could use .bind('click', aClick) instead but for variety...
     $("#theone").click(aClick)
                 .text("Can Click!");
   });
   $("#unbind").click(function () {
     $("#theone").unbind('click', aClick)
                 .text("Does nothing...");
   });

  });
  </script>
  <style>
  button { margin:5px; }
  button#theone { color:red; background:yellow; }
  </style>
</head>
<body>
  <button id="theone">Does nothing...</button>
  <button id="bind">Bind Click</button>
  <button id="unbind">Unbind Click</button>
  <div style="display:none;">Click!</div>
</body>
</html>



7. hover( over, out )  Returns: jQuery
hover( over, out )  ½ÇÇàÈÄ jQuery °´Ã¼¸¦ ¹Ýȯ

Simulates hovering (moving the mouse on, and off, an object). This is a custom method which provides an 'in' to a frequent task.
¸¶¿ì½º ¿À¹ö¿Í ¾Æ¿ô½Ã ÇàÀ§¸¦ ÁöÁ¤ÇÒ¼ö ÀÖ´Ù.

<!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(){
  
   $("li").hover(
     function () {
       $(this).append($("<span> ***</span>"));
     },
     function () {
       $(this).find("span:last").remove();
     }
   );

  });
  </script>
  <style>
  ul { margin-left:20px; color:blue; }
  li { cursor:default; }
  span { color:red; }
  </style>
</head>
<body>
  <ul>
   <li>Milk</li>
   <li>Bread</li>
   <li>Chips</li>
   <li>Socks</li>
  </ul>
</body>



8. toggle( fn, fn )  Returns: jQuery
toggle( fn, fn )  ½ÇÇàÈÄ jQuery °´Ã¼ ¹Ýȯ

Toggle between two function calls every other click.
Ŭ¸¯½Ã µÎ°³ÀÇ ÇÔ¼ö¸¦ ¹Ýº¹ÀûÀ¸·Î ½ÇÇà

<!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(){
  
   $("li").toggle(
     function () {
       $(this).css("list-style-type", "disc")
              .css("color", "blue");
     },
     function () {
       $(this).css({"list-style-type":"", "color":""});
     }
   );

  });
  </script>
  <style>
  ul { margin:10px; list-style:inside circle; font-weight:bold; }
  li { cursor:pointer; }
  </style>
</head>
<body>
  <ul>
   <li>Go to the store</li>
   <li>Pick up dinner</li>
   <li>Debug crash</li>
   <li>Take a jog</li>
  </ul>
</body>
</html>



9. blur( )  Returns: jQuery
blur( )  ½ÇÇàÈÄ jQuery °´Ã¼ ¹Ýȯ

Triggers the blur event of each matched element.



10. blur( fn )  Returns: jQuery
blur( fn )  ½ÇÇàÈÄ jQuery °´Ã¼ ¹Ýȯ

Bind a function to the blur event of each matched element.




11. change( )  Returns: jQuery
change( )  ½ÇÇàÈÄ jQuery °´Ã¼ ¹Ýȯ

Triggers the change event of each matched element.



12. change( fn )  Returns: jQuery
change( fn )  ½ÇÇàÈÄ jQuery °´Ã¼ ¹Ýȯ

Binds a function to the change event of each matched element.

<!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(){
  
   $("select").change(function () {
         var str = "";
         $("select option:selected").each(function () {
               str += $(this).text() + " ";
             });
         $("div").text(str);
       })
       .change();

  });
  </script>
  <style>
  div { color:red; }
  </style>
</head>
<body>
  <select name="sweets" multiple="multiple">
   <option>Chocolate</option>
   <option selected="selected">Candy</option>
   <option>Taffy</option>
   <option selected="selected">Carmel</option>
   <option>Fudge</option>
   <option>Cookie</option>
  </select>
  <div></div>
</body>
</html>



13. click( )  Returns: jQuery
click( )  ½ÇÇàÈÄ jQuery °´Ã¼ ¹Ýȯ

Triggers the click event of each matched element.


14. click( fn )  Returns: jQuery
click( fn )  ½ÇÇàÈÄ jQuery °´Ã¼ ¹Ýȯ

Binds a function to the click event of each matched element.

<!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(){
  
   $("p").click(function () {
     $(this).slideUp();
   });
   $("p").hover(function () {
     $(this).addClass("hilite");
   }, function () {
     $(this).removeClass("hilite");
   });

  });
  </script>
  <style>
  p { color:red; margin:5px; cursor:pointer; }
  p.hilite { background:yellow; }
  </style>
</head>
<body>
  <p>First Paragraph</p>
  <p>Second Paragraph</p>
  <p>Yet one more Paragraph</p>
</body>
</html>



15. dblclick( )  Returns: jQuery
dblclick( )  ½ÇÇàÈÄ jQuery °´Ã¼¸¦ ¸®ÅÏ

Triggers the dblclick event of each matched element.



16. dblclick( fn )  Returns: jQuery
dblclick( fn )  ½ÇÇàÈÄ jQuery °´Ã¼¸¦ ¸®ÅÏ

Binds a function to the dblclick event of each matched element.



17. error( )  Returns: jQuery
Triggers the error event of each matched element.


18. error( fn )  Returns: jQuery
Binds a function to the error event of each matched element.




19. focus( )  Returns: jQuery
Triggers the focus event of each matched element.

20. focus( fn )  Returns: jQuery
Binds a function to the focus event of each matched element.




21. keydown( )  Returns: jQuery
Triggers the keydown event of each matched element.

22. keydown( fn )  Returns: jQuery
Bind a function to the keydown event of each matched element.




23. keypress( )  Returns: jQuery
Triggers the keypress event of each matched element.

24. keypress( fn )  Returns: jQuery
Binds a function to the keypress event of each matched element.




25. keyup( )  Returns: jQuery
Triggers the keyup event of each matched element.

26. keyup( fn )  Returns: jQuery
Bind a function to the keyup event of each matched element.


27. load( fn )  Returns: jQuery
Binds a function to the load event of each matched element.




28. mousedown( fn )  Returns: jQuery
Binds a function to the mousedown event of each matched element.


29. mousemove( fn )  Returns: jQuery
Bind a function to the mousemove event of each matched element.


30. mouseout( fn )  Returns: jQuery
Bind a function to the mouseout event of each matched element.


31. mouseover( fn )  Returns: jQuery
Bind a function to the mouseover event of each matched element.


32. mouseup( fn )  Returns: jQuery
Bind a function to the mouseup event of each matched element.


33. resize( fn )  Returns: jQuery
Bind a function to the resize event of each matched element.




34. scroll( fn )  Returns: jQuery
Bind a function to the scroll event of each matched element.




35. select( )  Returns: jQuery
Trigger the select event of each matched element.

36. select( fn )  Returns: jQuery
Bind a function to the select event of each matched element.




37. submit( )  Returns: jQuery
Trigger the submit event of each matched element.

38. submit( fn )  Returns: jQuery
Bind a function to the submit event of each matched element.




39. unload( fn )  Returns: jQuery
Binds a function to the unload event of each matched element.





<Effect>

1. show( )  Returns: jQuery
Displays each of the set of matched elements if they are hidden.

<!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(){
   $("p").show()
  });
  </script>

</head>
<body>
  <p style="display:none">Hello</p>
</body>
</html>



2. show( speed, callback )  Returns: jQuery
Show all matched elements using a graceful animation and firing an optional callback after completion.
##A string representing one of the three predefined speeds ("slow", "normal", or "fast") or the number of milliseconds to run the animation (e.g. 1000).

<!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(){

   $("button").click(function () {
     $("p").show("slow");
   });

  });
  </script>
  <style>
  p { background:yellow; }
  </style>
</head>
<body>
  <button>Show it</button>
  <p style="display: none">Hello</p>
</body>
</html>



3. hide( )  Returns: jQuery
Hides each of the set of matched elements if they are shown.

<!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(){

   $("p").hide();
   $("a").click(function () {
     $(this).hide();
     return false;
   });

  });
  </script>

</head>
<body>
  <p>Hello</p>
  <a href="#">Click to hide me too</a>
  <p>Here is another paragraph</p>
</body>
</html>



4. hide( speed, callback )  Returns: jQuery
Hide all matched elements using a graceful animation and firing an optional callback after completion.

<!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(){

   $("button").click(function () {
     $("p").hide("slow");
   });

  });
  </script>
  <style>
  p { background:#dad; font-weight:bold; }
  </style>
</head>
<body>
  <button>Hide 'em</button>
  <p>Hiya</p>
  <p>Such interesting text, eh?</p>
</body>
</html>



5. toggle( )  Returns: jQuery
Toggles each of the set of matched elements.

<!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(){

   $("button").click(function () {
     $("p").toggle();
   });

  });
  </script>

</head>
<body>
  <button>Toggle</button>
  <p>Hello</p>
  <p style="display: none">Good Bye</p>
</body>
</html>



6. slideDown( speed, callback )  Returns: jQuery
Reveal all matched elements by adjusting their height and firing an optional callback after completion.

<!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(){

   $(document.body).click(function () {
     if ($("div:first").is(":hidden")) {
       $("div").slideDown("slow");
     } else {
       $("div").hide();
     }
   });

  });
  </script>
  <style>
  div { background:#de9a44; margin:3px; width:80px;
       height:40px; display:none; float:left; }
  </style>
</head>
<body>
  Click me!
  <div></div>
  <div></div>
  <div></div>
</body>
</html>



7. slideUp( speed, callback )  Returns: jQuery
Hide all matched elements by adjusting their height and firing an optional callback after completion.

<!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(){

   $(document.body).click(function () {
     if ($("div:first").is(":hidden")) {
       $("div").show("fast");
     } else {
       $("div").slideUp();
     }
   });

  });
  </script>
  <style>
  div { background:#3d9a44; margin:3px; width:80px;
       height:40px; float:left; }
  </style>
</head>
<body>
  Click me!
  <div></div>
  <div></div>
  <div></div>
  <div></div>
  <div></div>
</body>
</html>





8. slideToggle( speed, callback )  Returns: jQuery
Toggle the visibility of all matched elements by adjusting their height and firing an optional callback after completion.

<!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(){

   $("button").click(function () {
     $("p").slideToggle("slow");
   });

  });
  </script>
  <style>
  p { width:400px; }
  </style>
</head>
<body>
  <button>Toggle</button>
  <p>
   This is the paragraph to end all paragraphs.  You
   should feel <em>lucky</em> to have seen such a paragraph in
   your life.  Congratulations!
  </p>
</body>
</html>



9. fadeIn( speed, callback )  Returns: jQuery
Fade in all matched elements by adjusting their opacity and firing an optional callback after completion.

<!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(){

   $(document.body).click(function () {
     $("div:hidden:first").fadeIn("slow");
   });

  });
  </script>
  <style>
  span { color:red; cursor:pointer; }
  div { margin:3px; width:80px; display:none;
       height:80px; float:left; }
  div#one { background:#f00; }
  div#two { background:#0f0; }
  div#three { background:#00f; }
  </style>
</head>
<body>
  <span>Click here...</span>
  <div id="one"></div>
  <div id="two"></div>
  <div id="three"></div>
</body>
</html>




10. fadeOut( speed, callback )  Returns: jQuery
Fade out all matched elements by adjusting their opacity and firing an optional callback after completion.

<!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(){

   $("p").click(function () {
     $("p").fadeOut("slow");
   });

  });
  </script>
  <style>
  p { font-size:150%; cursor:pointer; }
  </style>
</head>
<body>
  <p>
   If you click on this paragraph
   you'll see it just fade away.
  </p>
</body>
</html>



11. fadeTo( speed, opacity, callback )  Returns: jQuery
Fade the opacity of all matched elements to a specified opacity and firing an optional callback after completion.

<!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(){

   $("p:first").click(function () {
     $(this).fadeTo("slow", 0.33);
   });

  });
  </script>

</head>
<body>
  <p>
   Click this paragraph to see it fade.
  </p>
  <p>
   Compare to this one that won't fade.
  </p>
</body>
</html>



12. animate( params, duration, easing, callback )  Returns: jQuery
A function for making your own, custom animations.

<!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(){

   $("#right").click(function(){
     $(".block").animate({"left": "+=50px"}, "slow");
   });

   $("#left").click(function(){
     $(".block").animate({"left": "-=50px"}, "slow");
   });

  });
  </script>
  <style>
  div {
   position:absolute;
   background-color:#abc;
   left:50px;
   width:90px;
   height:90px;
   margin:5px;
  }
  </style>
</head>
<body>
  <button id="left">¡ì</button> <button id="right">¡í</button>
<div class="block"></div>

</body>
</html>



13. animate( params, options )  Returns: jQuery
A function for making your own, custom animations.

<!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(){

   // Using multiple unit types within one animation.
   $("#go").click(function(){
     $("#block").animate({
       width: "70%",
       opacity: 0.4,
       marginLeft: "0.6in",
       fontSize: "3em",
       borderWidth: "10px"
     }, 1500 );
   });

  });
  </script>
  <style>
  div {
   background-color:#bca;
   width:100px;
   border:1px solid green;
  }
  </style>
</head>
<body>
  <button id="go">¡í Run</button>
  <div id="block">Hello!</div>
</body>
</html>



14. stop( )  Returns: jQuery
Stops all the currently running animations on all the specified elements.

<!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(){

   // Start animation
   $("#go").click(function(){
     $(".block").animate({left: '+=100px'}, 2000);
   });

   // Stop animation when button is clicked
   $("#stop").click(function(){
     $(".block").stop();
   });

   // Start animation in the opposite direction
   $("#back").click(function(){
     $(".block").animate({left: '-=100px'}, 2000);
   });

  });
  </script>
  <style>div {
   position: absolute;
   background-color: #abc;
   left: 0px;
   top:30px;
   width: 60px;
   height: 60px;
   margin: 5px;
  }
  </style>
</head>
<body>
  <button id="go">Go</button>
  <button id="stop">STOP!</button>
  <button id="back">Back</button>
  <div class="block"></div>
</body>
</html>



15. queue( )  Returns: Array<Function>
Returns a reference to the first element's queue (which is an array of functions).

<!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(){

   $("#show").click(function () {
     var n = $("div").queue("fx");
     $("span").text("Queue length is: " + n.length);
   });
   function runIt() {
     $("div").show("slow");
     $("div").animate({left:'+=200'},2000);
     $("div").slideToggle(1000);
     $("div").slideToggle("fast");
     $("div").animate({left:'-=200'},1500);
     $("div").hide("slow");
     $("div").show(1200);
     $("div").slideUp("normal", runIt);
   }
   runIt();

  });
  </script>
  <style>
  div { margin:3px; width:40px; height:40px;
       position:absolute; left:0px; top:30px;
       background:green; display:none; }
  div.newcolor { background:blue; }
  span { color:red; }
  </style>
</head>
<body>
  <button id="show">Show Length of Queue</button>
  <span></span>
  <div></div>
</body>
</html>



16. queue( callback )
Adds a new function, to be executed, onto the end of the queue of all matched elements.

<!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(){

   $(document.body).click(function () {
     $("div").show("slow");
     $("div").animate({left:'+=200'},2000);
     $("div").queue(function () {
       $(this).addClass("newcolor");
       $(this).dequeue();
     });
     $("div").animate({left:'-=200'},500);
     $("div").queue(function () {
       $(this).removeClass("newcolor");
       $(this).dequeue();
     });
     $("div").slideUp();
   });

  });
  </script>
  <style>
  div { margin:3px; width:40px; height:40px;
       position:absolute; left:0px; top:30px;
       background:green; display:none; }
  div.newcolor { background:blue; }
  </style>
</head>
<body>
  Click here...
  <div></div>
</body>
</html>



17. queue( queue )
Replaces the queue of all matched element with this new queue (the array of functions).

<!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(){

   $("#start").click(function () {
     $("div").show("slow");
     $("div").animate({left:'+=200'},5000);
     $("div").queue(function () {
       $(this).addClass("newcolor");
       $(this).dequeue();
     });
     $("div").animate({left:'-=200'},1500);
     $("div").queue(function () {
       $(this).removeClass("newcolor");
       $(this).dequeue();
     });
     $("div").slideUp();
   });
   $("#stop").click(function () {
     $("div").queue("fx", []);
     $("div").stop();
   });

  });
  </script>
  <style>
  div { margin:3px; width:40px; height:40px;
       position:absolute; left:0px; top:30px;
       background:green; display:none; }
  div.newcolor { background:blue; }
  </style>
</head>
<body>
  <button id="start">Start</button>
  <button id="stop">Stop</button>
  <div></div>
</body>
</html>



18. dequeue( )  Returns: jQuery
Removes a queued function from the front of the queue and executes it.

<!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(){

   $("button").click(function () {
     $("div").animate({left:'+=200px'}, 2000);
     $("div").animate({top:'0px'}, 600);
     $("div").queue(function () {
       $(this).toggleClass("red");
       $(this).dequeue();
     });
     $("div").animate({left:'10px', top:'30px'}, 700);
   });

  });
  </script>
  <style>
  div { margin:3px; width:50px; position:absolute;
       height:50px; left:10px; top:30px;
       background-color:yellow; }
  div.red { background-color:red; }
  </style>
</head>
<body>
  <button>Start</button>
  <div></div>
</body>
</html>

ÃßõÃßõ : 604 Ãßõ ¸ñ·Ï
¹øÈ£ Á¦¸ñ
2,885
input ÀÔ·Â ÇÊµå ¾ÕµÚ °ø¹é ½Ç½Ã°£ Á¦°Å
2,884
Placeholder Æ÷Ä¿½º½Ã °¨Ãß±â
2,883
MySQL Áߺ¹µÈ µ¥ÀÌÅ͸¦ »èÁ¦
2,882
MySQL Áߺ¹ µ¥ÀÌÅÍ È®ÀÎ
2,881
sessionStorage.getItem ¿Í sessionStorage.setItem
2,880
Á¦ÀÌÄõ¸® ·£´ýÀ¸·Î ¹è°æ»ö º¯°æ
2,879
preg match¿¡ °üÇÑ Á¤±Ô½Ä
2,878
Stream an audio file with MediaPlayer ¿Àµð¿À ÆÄÀÏ ½ºÆ®¸®¹Ö Çϱâ
2,877
Audio Streaming PHP Code
2,876
PHP $ SERVER ȯ°æ º¯¼ö Á¤¸®
2,875
Vimeo (ºñ¸Þ¿À) API ¸¦ »ç¿ëÇÏ¿© Ç÷¹À̾î ÄÁÆ®·ÑÇϱâ
2,874
iframe »ç¿ë½Ã ÇÏ´Ü¿¡ ¹ß»ýÇÏ´Â °ø¹é Á¦°Å¹æ¹ý
2,873
¾ÆÀÌÇÁ·¹ÀÓ(iframe) Àüüȭ¸é °¡´ÉÇÏ°Ô Çϱâ
2,872
ºÎÆ®½ºÆ®·¦(bootstrapk)¿¡¼­ »ç¿ëÇÏ´Â class¸í Á¤¸®
2,871
ºÎÆ®½ºÆ®·¦ CSS
2,870
Å©·Ò¿¡¼­ ¸¶Áø Á¶Àý
2,869
PHP ÇöÀç ÆäÀÌÁöÀÇ µµ¸ÞÀθíÀ̳ª urlµîÀÇ Á¤º¸ ¾Ë¾Æ¿À±â
2,868
PHP preg match all()
2,867
PHP ·Î À¥ÆäÀÌÁö ±Ü¾î¿À±â ¸ðµç ¹æ¹ý ÃÑÁ¤¸®!
2,866
[PHP] ¿ø°ÝÁö ÆÄÀÏ ÁÖ¼Ò ³ëÃâ ¾ÈÇÏ°í curl·Î ´Ù¿î·Îµå ¹Þ±â
2,865
PHP ÇÔ¼ö Á¤¸®
2,864
¾ÆÀÌÇÁ·¹ÀÓ(iframe) ºñÀ² À¯ÁöÇϸ鼭 Å©±â Á¶ÀýÇÏ´Â ¹æ¹ý
2,863
PHP ¹è¿­¿¡¼­ ¹«ÀÛÀ§·Î Çϳª »Ì¾ÆÁÖ´Â array rand() ÇÔ¼ö
2,862
PHP Á¤±Ô½Ä Á¤¸®
2,861
PHP Á¤±Ô½ÄÀ» È°¿ëÇÑ ÅÂ±× ¹× ƯÁ¤ ¹®ÀÚ¿­ Á¦°Å ¹× ÃßÃâ ¹æ¹ý
2,860
php Å©·Ñ¸µ ¶Ç´Â ÆÄ½Ì ÇÔ¼ö, Á¤±Ô½Ä ¸ðÀ½
2,859
Á¦ÀÌÄõ¸® ±âº» ¸í·É¾î
2,858
À¥ÆäÀÌÁö °¡·Î ¸ðµå¼¼·Î ¸ðµå ÀνÄÇϱâ
2,857
¸ð¹ÙÀÏ À¥ È­¸é °­Á¦ ȸÀü(°¡·Î¸ðµå °íÁ¤)
2,856
[HTML5]¿¡¼­ frameset ´ëü ¹æ¹ý°ú iframe ¼Ó¼º
¸ñ·Ï
¹ÂÁ÷Æ®·ÎÆ® ºÎ»ê±¤¿ª½Ã ºÎ»êÁø±¸ °¡¾ßµ¿ ¤Ó °³ÀÎÁ¤º¸Ãë±Þ¹æħ
Copyright ¨Ï musictrot All rights reserved.