「jQuery入門」find()とchildren()のサンプルコード
サンプルコード
$(function() {
$('#testFind').click(function() {
// find()で「#cft」内にすべての「a」要素を取得する
$('#cft').find('a').css('color','green');
});
$('#testChild').click(function() {
// children()で「#cft」の一階層下にある「a」要素を取得する
$('#cft').children('a').fadeOut();
});
});