jQuery选择器
基本选择器
console.log($('#box'));
console.log($('.box'));
$('.box').css('color', 'red');
console.log($('div'));
console.log($('.box,p'));
console.log($('div.box_1'));
层级选择器
console.log($('#list>li'));
console.log($('#list li'));
过滤选择器
console.log($('li:eq(3)').css('color', 'green'));
console.log($('li:odd').css('font-size', '30px'));
console.log($('li:even').css('background-color', 'grey'));
筛选选择器
console.log($('#list').children());
console.log($('#list').children('li'));
console.log($('#list').find('li'));
console.log($('#list_3').siblings());
console.log($('#list_3').siblings('li'));
console.log($('#list_3').siblings('ol'));
console.log($('#list_3').parent());
console.log($('#list_3').parents());
console.log($('li').eq(4));
console.log($('#list_3').next());
console.log($('#list_3').nextAll());
console.log($('#list_3').prev());
console.log($('#list_3').prevAll());
console.log($('#list_3').index());
console.log($("li").eq($('#list_3').index()));
console.log($('#list_3').siblings().not('li'));