2013-12-05から1日間の記事一覧
jQuery.each 系のeach list = ["a", "b", "c"] list = $.each( list ,function(i,e){console.log(e)}) a b c e => エレメント i => インデックス JavaScript 1.6 から導入された forEach 系 list = ["a", "b", "c"] list.forEach(function(e,i){ console.log…
テーブルのtd の先頭から3つを取得するCSS3 nth-childセレクタを作れたら嬉しいデスって話で盛り上がった。 td の先頭から3つに要素を適用したい <table> <tr> <td>1番目 <td>2番目 <td>3番目 <td>4番目 <td>5番目 </tr> </table> 直ぐ思い浮かぶ回答 td:nth-child(1),td:nth-child(2),td:nth-child(…