dom: implements find ancestor function(ancestor)