jQuery this and Selector $(this:first-child).css('color', 'red'); -
is possible use :selector following in jquery?
$('.galler_attr').bind('click', function() { $(this:first-child).css('color', 'red'); });
no. you're trying mix function context string.
use this context of selector or call find() on $(this) search within dom scope of element. either
$('.galler_attr').bind('click', function() { $(this).find(':first-child').css('color', 'red'); }); or (which resolves above internally):
$('.galler_attr').bind('click', function() { $(':first-child', this).css('color', 'red'); });
Comments
Post a Comment