How about writing a filter like below,
$('[myc="blue"]').filter(function () {
return (this.id == '1' || this.id == '3');
});
Edit: @Jack Thanks.. totally missed it..
$('[myc="blue"]').filter(function() {
var myId = $(this).attr('myid');
return (myId == '1' || myId == '3');
});