Please try is as below.
This will produce a subset of the elements matched by the inital selector that have the id rowid OR class realclass:
$(selector).filter("'#' + rowid, '.' + realclass");
This will produce a subset of the elements matched by the inital selector that have BOTH the id rowid AND class realclass:
$(selector).filter("'#' + rowid. + realclass");
LIVE DEMO : JsFiddle