From this:
var $saved = $(\'#parent\').find(\'a\');
How can I now subselect those elements in $saved
which have class my
You can use filter method:
var $refined = $saved.filter(".myClass");
$saved.each(function(){
if($(this).hasClass('test')) alert($(this).text());
});
You can iterate through saved collection to find out the elements with class myClass.
var $refined = $saved.each(function(){
if($(this).attr('class') == 'myClass')
return $(this);
});
Or you can use filter() jquery function to apply selector.
var $refined = $saved.filter('myClass');
You can use filter
method.
var $refined = $saved.filter('.myClass');
may be this one can help
var $refined = $saved.filter('.myClass');
http://api.jquery.com/filter/