tohokuaikiのチラシの裏

技術的ネタとか。

2012-09-12から1日間の記事一覧

jQueryのparent()とparents()の違い

テストコード <html> <head> <script src=" http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.8.1.min.js"></script> <script> $(function(){ console.log($('.bold').parents()); console.log($('.bold').parent()); }) </script> </head> <body> <div>div, <span>span, </span> <b class="bold">b </b> </div> <p>p, <span>span…</span></p></body></html>